Playing an ogg stream in iOS

前端 未结 2 1522
旧时难觅i
旧时难觅i 2020-12-06 04:55

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 questi

相关标签:
2条回答
  • 2020-12-06 05:28

    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

    0 讨论(0)
  • 2020-12-06 05:39

    .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

    0 讨论(0)
提交回复
热议问题