简体   繁体   English

将由多个wav文件组成的单个wav文件导出到iPhone音乐库

[英]Exporting a single wav file made of multiple wav files to the iPhone music library

Is there any API for iOS that allows me to create a WAV file made up of several other WAV samples? 是否有适用于iOS的API,允许我创建由其他多个WAV示例组成的WAV文件? I am making a beat making app, the beat sound themselves are made of several small wav sounds like kick.wav, snare.wav etc. I want to assemble all these separate .wav sounds based on user's pattern to make a final output.wav. 我正在制作一个节拍制作应用程序,节拍声音本身是由几个小wav声音(例如kick.wav,snare.wav等)组成的。我想根据用户的模式将所有这些单独的.wav声音组合在一起,以生成最终的输出。 。 What should be the way to do this for iOS platform? 在iOS平台上应该怎么做?

There is no iOS API to do anything like that directly, file to file. 没有iOS API可以直接执行文件到文件的操作。

The sequence of steps to do it manually might include reading the WAV files into buffers of raw PCM samples (AVAssetReader), resampling if the sample rates aren't all appropriate, compositing the samples at appropriate time offsets using a DSP mixer (including gain control and limiting), then writing the resulting composite vector as a new WAV file. 手动执行此步骤的顺序可能包括将WAV文件读取到原始PCM样本的缓冲区(AVAssetReader)中,如果采样率不完全合适则重新采样,使用DSP混频器(包括增益控制)在适当的时间偏移处合成样本和限制),然后将生成的复合向量写入新的WAV文件。

Each of those steps might be a separate questions, and for more than one stackexchange site, as there is more than one way to resample and mix down samples, and doing it well might be non-trivial, depending on your exact requirements. 这些步骤中的每一个步骤可能都是一个单独的问题,对于一个以上的stackexchange网站,因为有多种方法可以对样本进行重新采样和混合,根据您的确切要求,做好它可能并非易事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM