iphone - AVAudioRecorder gives mono playback (sound playing in just one channel)

三世轮回 提交于 2019-12-06 15:51:29

No, nothing is wrong in your settings. If you try your app on the simulator it will record and play on two channels. However, iPhone 3G and 3GS only record audio using one channel. This apply also to the audio of movies shot on 3GS.

Therefore, it is not a bug.

grassyburrito

Just comment out the following line

[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];

The default setting should work.

The reason this works is that you will now be recording a mono file and when this is played back the audio will be played in each speaker as is the normal behaviour for a mono file. If you include this line you end up recording a stereo file with one channel completely silent so that when you play it back you only get audio in one ear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!