[Android-development] playing sound on Qt/Android

maitai at virtual-winds.org maitai at virtual-winds.org
Wed Nov 26 07:18:42 CET 2014


Hello,

What is the best way to play mp3 on Android with a 5.3.2 widget-based 
application (no QML)?

I have tried using QMultimedia and it works perfectly on windows/linux 
but fails on Android. It's not clear to me whether the problem is in 
ministro or just that it's not supported. I get this output in the 
console:

V/MediaPlayer-JNI(14123): native_setup
V/MediaPlayer(14123): constructor
V/MediaPlayer(14123): setListener
V/MediaPlayer-JNI(14123): setVolume: left 1.000000  right 1.000000
V/MediaPlayer(14123): MediaPlayer::setVolume(1.000000, 1.000000)
D/Qt MediaPlayer(14123): null
V/MediaPlayer-JNI(14123): reset
V/MediaPlayer(14123): reset
V/MediaPlayer-JNI(14123): release
V/MediaPlayer(14123): setListener
V/MediaPlayer(14123): disconnect
V/MediaPlayer(14123): destructor
V/MediaPlayer(14123): disconnect
I/dalvikvm(14123): threadid=13: stack overflow on call to 
Ljava/lang/Exception;.<init>:V
I/dalvikvm(14123):   method requires 4+20+4=28 bytes, fp is 0x7b0cf310 
(16 left)
I/dalvikvm(14123):   expanding stack end (0x7b0cf300 to 0x7b0cf000)
I/dalvikvm(14123): Shrank stack (to 0x7b0cf300, curFrame is 0x7b0cf33c)
W/dalvikvm(14123): Exception thrown (Ljava/lang/StackOverflowError;) 
while throwing internal exception (Ljava/lang/IllegalStateException;)

Is there an alternative way to play mp3? If not I hope at least I can 
use QSound/QSoundEffect to play .wav ...

Thanks,
Philippe Lelong



More information about the Android-development mailing list