문제

I tried to implement SoundEffect from QtMobilityKit in QML to play music file in Meego Harmattan. I found that it can only play .wav file. is there any possible way to play .mp3 file in meego?

This one can play

SoundEffect{
    id: sound
    source : "/sound.wav"
}

and this one cannot

SoundEffect{
    id: sound
    source : "/sound.mp3"
}
도움이 되었습니까?

해결책

I haven't tested this, as my N9 hasn't arrived yet, but I think the following should work:

Audio {
    id: sound
    source: "/sound.mp3"
    // Start playback as soon as clip is loaded
    onStatusChanged: if (Audio.Loaded == status) play()
}

Note that you may see a slightly longer delay in starting playback of the MP3 compared with the WAV, as the encoded clip requires some more parts of the native multimedia framework to be initialized before it can be decoded and played.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top