Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing an ogg stream in iOS

Has anyone played an ogg stream from iOS? What can I use without having to write my own decoder?

I'm using Apple's AVPlayer to play the stream.

This question has been asked as part of this thread: iOS online radio streaming questions but it hasn't been answered.

like image 592
nnyby Avatar asked May 29 '12 17:05

nnyby


2 Answers

There is no built-in support for playing ogg files in iOS, however, the source code for ogg compression/decompression is readily available (from xiph.com). It is fairly straightforward to compile this code for iOS and use it in an app.

I had a chance to compile the libraries and have made them available: "Precompiled Ogg Vorbis Libraries for iOS".

I have also made some sample source code available on GitHub that shows how to play decoded Ogg Vorbis audio on iOS: IDZAQAudioPlayer

like image 127
idz Avatar answered Nov 15 '22 23:11

idz


.ogg file may also be encoded in Opus or FLAC, refer to Ogg wiki. IDZAQAudioPlayer may not cover all cases.

For Opus codec, you may refer Telegram for iPhone source code: https://telegram.org/apps

like image 37
liruqi Avatar answered Nov 15 '22 21:11

liruqi