how to play .opus audio file in android?

﹥>﹥吖頭↗ 提交于 2019-12-07 13:43:31

问题


I'm developing an app for Recognize speech using google cloud speech APi and recording audio simultaneously. git link I tried to play recorded .opus audio file getting IOException W/System.err: java.io.IOException: setDataSource failed.

Any idea?? Thanks!!


回答1:


A user on the android stack exchange mentioned being able to play opus files when they have a .ogg extension in newer versions of Android.

Rename your .opus files to .ogg.




回答2:


I don't know about that specific error, but the Supported Media Formats page says Opus is only supported in Android 5.0+, and then only in the matroska container.

Make sure you're testing on newer Android, and you may need to demux manually to feed raw packets to the decoder.

If you need Opus support everywhere you can include the C library in your app and call it directly over JNI.



来源:https://stackoverflow.com/questions/44435259/how-to-play-opus-audio-file-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!