How to play raw pcm data in iphone sdk - ios

I am developing an application for voice chat. Now I want to play raw pcm audio data in iPhone. I could not achieve it. Can anyone help me to play pcm data?

You will need to read up on Audio Queue Services:
http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/Introduction/Introduction.html

Related

Extract CMSampleBuffer from HLS video stream on iOS

How can I save what AVPlayer is currently playing (both video and audio) from Live HLS stream?
I know how to load and play m3u8 video file using AVPlayer.
Please note that the HLS stream is live and not Video on demand so cannot use AVAggregateAssetDownloadTask In the perfect scenario will get CMSampleBuffer objects which can save to file easily. Also AVPlayerItemOutput is not entirely an option because I am unable to see how will get the audio channel.
Seems not possible with the current SDK. I've implemented it using ffmpeg

Encode Mic Audio CMSamplebuffer to AAC

I used the code found at the link below. It doesn't work with iPhone 5 as no audio is processed(while the mic are ok). For iPhone 6s the audio quality is good Only when the headphone is connected but without it the audio has a gap for like every other second.
https://github.com/chrisballinger/FFmpeg-iOS-Encoder/blob/master/FFmpegEncoder/AACEncoder.m
Can you suggest a better approach on encoding audio from the mic? I am sending the data to a server and writing to file is NOT an option unless it is fast and I can grab the AAC data with timestamps.

Intercept/modify audio stream on iOS

I am looking at the feasibility of getting the current raw audio stream playing and do stuff with it such as stream it over Bluetooth or equalize it, etc. Is there any way to do this in iOS 8?
For example: apps such as Pandora/Spotify are playing music and I want to access the audio they are playing.
To process audio from another app, that app needs to participate in Inter-App Audio.
I don't know if your example apps do that.

Play NSDATA into audio format IOS

I have NSDATA which is recorded through AudioQueue , I want to play this audio through any AUDIO player on IOS, Please help on this.
Thanks
Djrecker
Save it as an audio file (e.g. WAV). AudioFile and ExtAudioFile APIs can help you write this.
You can't expect any audio player on iOS to interpret/guess a blob of sample data correctly. This is why file formats exist -- audio file formats can specify sample count, channel count, sample rate, sample format, and a ton of other information about the audio in the file. Using an audio file, you can exchange this recording in a format other programs are able to read (correctly).

How to play stream audio in iPhone/iPad

I want to play sounds from an internet server in my own program. But the sample codes Apple supplied concerned about sound play are all open an audio file, and then play it.
I want to know how can I play PCM data from memory, which received from internet continuously. Either OpenAL or AudioQueue is OK.
Give this a look:
http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AudioandVideoTechnologies/AudioandVideoTechnologies.html#//apple_ref/doc/uid/TP40007072-CH19-SW8

Resources