Recording audio output only from speaker of iphone excluding microphone

ⅰ亾dé卋堺 提交于 2019-12-12 00:03:06

问题


I am trying to record the sound from iPhone speaker. I am able to do that, but I am unable to avoid mic input in the recorded output. Tried with sample code available in different websites with no luck.

The sample which I used does the recording with audio units. I need to know if there is any property for audio unit to set the mic input volume to zero. Above that I came to from other posts that Audio Queue services can do the thing for me. Can any one redirect me with sample code for the audio queue services implementation. I need to know whether there is a way of writing the data to an separate audio file before sending it as input to speaker.

Thanks in advance


回答1:


There is no public iOS API or property for recording generic audio sent to the iPhone speaker. Only mic input can be recorded.

But if you are playing audio in your app using only uncompressed samples with Audio Queues or the RemoteIO Audio Unit, you can just copy those samples to a file before you write them to the audio callback buffers. Those saved samples can be used to construct a recording.



来源:https://stackoverflow.com/questions/11540690/recording-audio-output-only-from-speaker-of-iphone-excluding-microphone

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