[Android-development] playing sound on Qt/Android
maitai at virtual-winds.org
maitai at virtual-winds.org
Wed Nov 26 18:11:02 CET 2014
Hmmm you're right it seems .wav files are not supported on this device
(samsung Galaxy S4/Android 4.4.2). I cannot play them with Sound Player
or Google Music or whatever, so it's not related to Qt finally :) I will
convert my wave files to wma since it seems to work on all platforms.
Thanks for your help...
Philippe Lelong
Le 26-11-2014 14:02, Christian Strømme a écrit :
> 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
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
More information about the Android-development
mailing list