使用 FMOD 保存输出而不播放
我需要实现N个通道中单独音频文件的播放,文件可以顺序播放或并行播放。我需要在Android上实现它。
时间轴:
|文件 a...|文件 d....|文件 b...|......|文件 k|....
|.....|文件 g|文件 c.. |file p.|...
我正在考虑两种选择,一种是 FMOD 来解压缩文件并同时播放它们。我研究过,FMOD 似乎很适合,并且比使用 AudioTrack 手动播放要容易得多。但是,我不明白 FMOD 是否允许我们保存整个合并的输出而不播放它。
我知道使用解决方案此处我们可以将输出重定向到 wav 文件,但是是否可以立即创建最终输出并使用 FMOD 保存它?或者我是否必须手动将 PCMS 合并到一个流中。
谢谢。
I need to implement a playback of separate audio files in N channels, files may play sequentially or in parallel. I need to implement it on Android.
Timeline:
|file a...|file d....|file b...|......|file k|....
|.....|file g|file c..|file p.|....
I'm thinking two options, one being FMOD to decompress files and play them simultaneously. I have researched and FMOD seems to fit well and much easier than manually playing this using an AudioTrack. However, I can't understand if FMOD would allow us to save the entire merged output without playing it through.
I know that using solution here we can redirect output to a wav file, but is it possible to just create a final output instantly and save it using FMOD? Or will I have to manually merge PCMS into one stream after all..
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里的一个重要问题是为什么需要保存文件,如果可以离线执行此操作那么会简单得多。如果您必须录制多个文件的串联(包括并行播放的其他文件),则使用 FMOD 是完全可能的。
一种方法是使用 wave-writer-nrt 输出模式,该模式允许您输出基于 FMOD 的 wav 文件,以比实时更快的速度播放声音调用。
另一种方法是使用自定义 DSP 在播放任何子混音时访问其数据流,如果您希望其他声音同时实际播放,这很有用。
另一种方法是简单地创建声音对象,然后使用 Sound::lock 来访问 PCM 数据,您可以将其连接到目的地。请记住,所有声音都需要具有相同的采样率和通道,否则您将需要进行处理。另请记住,除非您想自己混合音频,否则不能对并行声音执行此操作。
An important question here is why you need to save the files out, if it's possible to do this offline then it would be a lot simpler. If you must record the concatenation of several files (including others played in parallel), it is quite possible with FMOD.
One way would be to use wave-writer-nrt output mode, which allows you to output a wav file based on FMOD playsound calls in faster than realtime.
Another way is to use a custom DSP to access the data stream of any submix as it plays, useful if you want other sounds actually playing at the same time.
Another is simply create the sound objects, then use Sound::lock to access the PCM data, which you could concatenate yourself to a destination. Keep in mind all the sounds would need to be the same sample rate and channels, otherwise you would need to do processing. Also keep in mind you cannot do this for parallel sounds unless you want to mix the audio yourself.