Recording audio output only from speaker of iphone excluding microphone - iphone

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

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.

Related

Making Audio capturer and Audio player ios

I have sucessfully made Audio Capturer and Audio Player using audio unit.
Now my requirement is to make a conference call where i have one audio Capturer but multiple audio Players ...When testing i can only hear sound from one player. Can i make Multiple player with single audio unit ? Plz help
Linear PCM and IMA4 (IMA/ADPCM) You can play multiple linear PCM or IMA4 sounds simultaneously in iOS without incurring CPU resource problems. The same is true for the iLBC speech-quality format, and for the ยต-law and a-law compressed formats. When using compressed formats, check the sound quality to ensure it meets your needs. Ref
Using Linear PCM it should be able to play simultaneously.
Another solution I can think of is use a Mixer Audio Unit and send all your players to the Mixer and play the output.

Recording Radio Streaming in IOS

I am working on radio app in which i want to record live radio streaming on an record button click.It should record just the radio streaming sound. Currently i am recording from Mike but its not the way i want as it also captures the surrounding/background voice. I did read few post but all of them are regarding AVaudioRecorder. I have used wunderradio api for playing the radio from url. I haven't got any method/function in their api which will record that audio from url. I want to record the buffered audio only from that url,so that I can play that recorded file later.
Any help would be appreciated.
Recording audio playback by using the microphone is really not the right way to do it. If you're using AudioQueue services for audio playback you can use the AudioFileWritePackets function to write audio data to a file.
If you implement recording this way you can write audio files in the format they're streamed in. So an mp3 audio stream can be written as an mp3 file to disk since you're writing encoded audio packets with the AudioFileWritePackets function.
To get a better understanding of how this all should be implemented you can have a look at the SpeakHere sample code of Apple. The SpeakHere project records from the microphone but it's still a good example to see how the AudioFileWritePackets function works. In your case you need to use the AudioFileWritePackets function in the output callback of your AudioQueue. This is the callback that's called when a buffer is finished playing. So it's a good to place to write the already played audio buffers data to a file.

Record iphone System or audio player sound

I am developing an app module in which i am doing audio recording with also video recording.
but i want to record only device intrnal playing sound , not the device external voice.
If any advise or suggestion to got it..!!
I'm not sure but maybe you can use buffers to write them into a file Audio units or Audio Queues without using mic

Is there a way to record device audio on the iPhone?

AVAudioRecorder allows the recording of external audio. However I wish to record the audio made by my application (through numerous AVAudioPlayers), is this possible on the iPhone?
If you want to record the sounds your iOS app makes, you have to use a much lower lever API, such as Audio Unit RemoteIO, or Audio Queues with raw PCM audio samples.

iPhone recording audio

I'm currently working on a project where it is necessary to record sound being played by the iPhone. By this, I mean recording sound being played in the background like a sound clip or whatever, NOT using the built-in microphone.
Can this be done? I am currently experimenting with the AVAudioRecorder but this only captures sound with the built-in microphone.
Any help would be appreciated!
This is possible only when using only the Audio Unit RemoteIO API or only the Audio Queue API with uncompressed raw audio, and with no background audio mixed in. Then you have full access to the audio samples, and can queue them up to be saved in a file.
It is not possible to record sound output of the device itself using any of the other public audio APIs.
Just to elaborate on hotpaw2's answer, if you are responsible for generating the sound then you can retrieve it. But if you are not, you cannot. You only have any control over sounds in your process. yes, you can choose to stifle sounds coming from different processes. but you can't actually get the data for these sounds or process them in any way.