can not play ogg on android

狂风中的少年 提交于 2019-12-23 09:59:53

问题


does somenone knows what this means? the ogg is played with phonegap`s Meda, which uses MediaPlayer

05-26 15:41:50.007  1160  3631 E AudioFlinger: no more track names available
05-26 15:41:50.007  1160  3631 E AudioTrack: AudioFlinger could not create track, status: -12
05-26 15:41:50.007  1160  3631 E AudioSink: Unable to create audio track
05-26 15:41:50.007  1160  3631 E VorbisPlayer: mAudioSink open failed

thanks!

edit:

new Media('/android_asset/www/sounds/0.mp3',
        function() {
        //alert("playAudio():Audio Success");
    },
        function(err, arg) {
            alert(err + ' ' + arg);
    }).play()

回答1:


According to this post, you need to play ogg files with constant bitrate. Variable bitrate will cause SoundPool to crash.

There is a bug report about the same error message, but a different cause, here: http://code.google.com/p/android/issues/detail?id=13453




回答2:


I've had Ogg Vorbis music files that the internal Android player wouldn't play and I've found that removing all the Tags embedded in the file solved the problem. Variable bit rate and high bit rate doesn't seem to be the issue for me. The issue seems to be that the internal Android player chokes if the Ogg Vorbis file contains tags in certain formats. I haven't figured out precisely which tags in which formats are the problem. Some work. Some don't. I'll keep looking into the issue.




回答3:


I was able to solve this, but it is more like a workaround. To me it seems like Android is not capable to play ogg-files which have a too high bitrate. I re-encoded my ogg-files in audacity. In Audacity under 'file - export - options' you can configure the ogg-quality. I have set the quality to 0 (I do not hear any difference).

For another song I had to re-encode my ogg to mp3 (48khz) and then back to ogg.



来源:https://stackoverflow.com/questions/6139545/can-not-play-ogg-on-android

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