can not play ogg on android

2019-06-21 11:39发布

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()

标签: android ogg
3条回答
smile是对你的礼貌
2楼-- · 2019-06-21 11:55

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

查看更多
我想做一个坏孩纸
3楼-- · 2019-06-21 11:55

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.

查看更多
相关推荐>>
4楼-- · 2019-06-21 11:56

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.

查看更多
登录 后发表回答