Play NSDATA into audio format IOS - 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).

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

Record audio and convert it to .wav

I need to make an app that sends recorded audio in .wav format to a REST endpoint. I will be using AFNetworking for the POST, but I am not sure where to go with recording the audio and then converting it. I know I should use AVFoundation to record, but I am not sure how to convert. Would CoreAudio help?

Stream only audio track from mp4 file

I have a remote MP4 file that has video and sound. I want to only stream the audio track of the mp4 file. I don't need the video and want to decrease the internet usage in my app. I have no idea where to start with this, Google doesn't seem to help. Is this impossible? Any ideas?
You can't... If you want audio only, you need to split video / audio on the server or put a stream software (like vlc, ffmpeg or mplayer) who can re-encode file in realtime (so you can drop video for new stream)
It's better, for me, to process all files on server and extract audio track...

Record Audio in.wav format

How can I record audio in .WAV format in my iPhone application.Can any one help me out.
Thanks
You can use AVAudioRecorder to record into .CAF format and then use Extended Audio File Services to convert CAF to WAV
You can also check this question:
Recording sound as WAV on iphone

How to play raw pcm data in iphone sdk

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

Resources