[Android-development] playing sound on Qt/Android

Christian Strømme christian.stromme at theqtcompany.com
Wed Nov 26 14:02:35 CET 2014



On 26/11/14 12:09 , maitai at virtual-winds.org wrote:
> Thanks for your reply.
>
> In fact I made further tests... and discover that the problem is with
> .wav files. If I select an mp3 it works perfectly on Android, but not
> with a wav file. If I use a QSoundEffect object to play the same wav
> file, it plays on Android. On windows, QMediaPlayer is able to play both
> formats.
>
> Is this a known issue? I uploaded the small wav file i'm using here:
> http://www.virtual-winds.org/maitai/horn.zip
>
> My code is very simple, since I am just testing for the time being:
>
>       QMediaPlayer *testPlayer = new QMediaPlayer(this);
>
> testPlayer->setMedia(QUrl::fromLocalFile(appFolder.value("userFiles") +
> "boat_horn.wav"));
>       testPlayer->setVolume(99);
>       testPlayer->play();
>       return;
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
>

No, this is not a known issue and it should work. I quickly tested your 
wave file and it plays fine here, so it might be specific to your 
device... Could you create a bug report with more information about your 
device (Manufacture, Android version etc.)?

--
Christian



More information about the Android-development mailing list