如何从您当时播放的所有声音中获取声音数据? (动作脚本闪光)
因此,如果我播放一种声音,我会使用
sound = new Sound(); ...
sound.addEventListener( SampleDataEvent.SAMPLE_DATA, onSampleData);
sound.play();
所以我会获取数据,但是如果我正在播放 20 个声音,并且我想从声音中获取数据,我在这里将其作为所有声音的数据混合的结果...如何获取它?
So If I play one sound I use
sound = new Sound(); ...
sound.addEventListener( SampleDataEvent.SAMPLE_DATA, onSampleData);
sound.play();
And so I'll get data, but If I have 20 sounds playing and I want to get data from the sound I here as a resalt of data mix of all that sounds... How to get it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 SoundMixer.computeSpectrum()。它不会在每个样本期间触发事件,但会创建一个将所有声音数据混合在一起的 ByteArray。然后您可以操纵该数据。
You can use SoundMixer.computeSpectrum(). It won't fire an event during each sample, but it will create a ByteArray with all the sound data mixed together. You can then manipulate that data.