How to play PCM data in AVPlayer? - ios

I am trying to play raw linear PCM in swift iOS received from socketio. I can convert the "NSData" to AVAudioPCMBuffer. How can I play it in AVPlayer?
I tried using MobileVlcKit but it doesn't accept live stream data.

Related

How to listen opusCodec in AVPlayer?

I am working on an watchOS app.
There is a .ogg opus file locally and I need to listen to it on AVplayer.
But AVPlayer currently does not support it.
To listen on AVPlayer, I need to decode the opus file as I understand. So I followed these two threads which are
How to decode self-delimited opus in iOS and How to encode and decode Real-time Audio using OpusCodec in IOS? but I couldn't succeed.
I always get error while decoding data.
I have been trying for 2 days to find a solution. Can anybody explain how I can do it?

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

Detect when switched to an audio only HLS Stream

In our app, we have an HLS index file which contains multiple HLS streams for different Bandwidths. Our Lowest Badwidth stream is only audio.
We want to show a message to our users when the app has degraded to the Audio Only stream.
Is there a way to detect when we have switched to an audio only stream?
Thanks!

Is it possible to parse and streaming the Audio data using AVaudioplayer in iOS without using audioqueue?

Our projects is about parse and streaming the audio data from iP-camera. is it possible to streaming the audio data using avaudioplayer without using audioqueue?

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