Unity 3d FFT频谱与程序音频(Unity 3d FFT spectrum with procedural audio)
我正在使用Unity 3d上的OnAudioFilterRead方法生成一些程序音频,并且它正在工作,因为我可以听到来自扬声器的合成声音。
当我试图获得合成声音的频谱(在同一个脚本中)时
void Update() { float[] data = new float[2048]; audioSource.GetSpectrumData(data, 0, FFTWindow.BlackmanHarris); }
它总是用0填充
data
数组(没有异常抛出)。 有没有办法获得合成音频的真实频谱?I'm generating some procedural audio by using the OnAudioFilterRead method on Unity 3d, and it's working beause I can hear the synthesized sound from the speaker.
When I'm trying to get the spectrum of the synthesized sound (in the same script) with
void Update() { float[] data = new float[2048]; audioSource.GetSpectrumData(data, 0, FFTWindow.BlackmanHarris); }
It always fills
data
array with 0 (no exception thrown). Is there any way to get the real spectrum of the synthesized audio?
原文:https://stackoverflow.com/questions/32091366
最满意答案
看来,Office程序作为一项服务运行时,需要系统本地用户拥有一个桌面文件夹,否则他们只会发现这些奇怪的错误。
因此,解决这个问题的方法是创建一个
C:\Windows\SysWOW64\config\systemprofile\Desktop
(在Windows 64)文件夹。As it appears, Office programs, when run as a service, require the system local user to have a desktop folder, otherwise they simply bug with those kind of weird errors.
As a consequence, the solution to such a problem is to create a
C:\Windows\SysWOW64\config\systemprofile\Desktop
(on Windows 64) folder.
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
它使用OLE自动化对象来保存文件,因此您必须找到指示文件类型的方法或参数。 这是我可以使用Word记录的宏: ActiveDocument.SaveAs filename:="asdd.htm", FileFormat:=wdFormatHTML, _ LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _ :="", ReadOnlyRecommended:=False, EmbedTrueTyp ...
-
看来,Office程序作为一项服务运行时,需要系统本地用户拥有一个桌面文件夹,否则他们只会发现这些奇怪的错误。 因此,解决这个问题的方法是创建一个C:\Windows\SysWOW64\config\systemprofile\Desktop (在Windows 64)文件夹。 As it appears, Office programs, when run as a service, require the system local user to have a desktop folder, other ...
-
如果您发布了错误以及您正在尝试做什么,将会有所帮助。 你有什么理由不使用Apache POI http://poi.apache.org/ 在任何一种情况下,我发现首先在VB中完成工作然后使用JACOB进行调用是有帮助的,因为它们可以轻松地映射到 Would help if you posted the errors and what exactly you are trying to do. Is there any reason you would not use Apache POI http://p ...
-
您的代码正在调用一个在Dispatch类中找不到的方法,该方法具有以下签名: Variant call(Dispatch dispatchTarget, String name, Object attributes) 查看Jacob文档,该类中的以下方法与该类最接近: Variant call(Dispatch dispatchTarget, String name, Object... attributes) 请注意,最后一个参数是不同的(vararg - Object数组)。 你是否针对不同版本的库 ...
-
Java JACOB检索给定Win32_ *类对象的所有属性(Java JACOB retrieve all the properties for a given Win32_* class object)[2022-02-12]
以下是您的问题的答案。 我希望如此,因为我不知道你的问题到底在哪里。 我仍然认为,在问你应该提供代码的一部分而不是要求回答者写一切。 这也可能是一个更普遍的问题的答案,我刚学到: 如何枚举集合中的所有项目,实现For Each构造? 一个人应该使用EnumVariant Jacob类。 import com.jacob.activeX.*; import com.jacob.com.*; public class testJacob { public static void main(String a ... -
经过一些搜索,我设法解决了我的问题...... 如果有人需要,这是代码。 ActiveXComponent wmi = new ActiveXComponent("WbemScripting.SWbemLocator"); Variant variantParameters[] = new Variant[4]; variantParameters[0] = new Variant(_IPADDRESS); variantParameters[1] = new Variant( ...
-
好吧,将它复制到“C:\ Program Files(x86)\ Java \ jre1.8.0_65 \ bin”文件夹中,它就可以了。 显然它只适用于jacob dll的。 Well, copied it into the "C:\Program Files (x86)\Java\jre1.8.0_65\bin" folder and it worked. Apparently it only looks there for the jacob dll's.
-
Jacob(Java / COM / ActiveX)抛出ComFailException(Jacob (Java / COM / ActiveX) Throws ComFailException)[2023-12-05]
我想知道是否有人遇到类似的问题。无论如何我没有其他选择,只能将我的机器恢复到上次工作日期。 我想一些JAVA-COM类条目会被意外地从注册表中删除。 不知道它到底是什么..最后“系统还原”是我的解决方案:) I wonder if anyone faced similar problem by any chance.. Anyways I had no other option than to restore my machine to last working date. I guess some JAV ...