2014年1月5日星期日

[Android] QSound problems playing sounds

I created a Qt quick project , which use QSound play a sound,
Now the sound files into the resources qrc file.
calling the following code

QSound sound(":sound/testsound.mp3");
        sound.play();

only beep once , did not play a sound file .
I checked the path is not wrong , how to modify how it can play a sound ? ?
------ Solution ---------------------------------------- ----
QSound does not support resource files

only play files on disk .
------ Solution ---------------------------------------- ----


should support it.

problem here is QSound does not support mp3 format file playback .
document is described:
Microsoft Windows The underlying multimedia system is used; only WAVE format sound files are supported.
X11 The Network Audio System is used if available, otherwise all operations work silently. NAS supports WAVE and AU files.
Mac OS X NSSound is used. All formats that NSSound supports, including QuickTime formats, are supported by Qt for Mac OS ; X.
Qt for Embedded Linux A built-in mixing sound server is used, accessing / dev / dsp directly. Only the WAVE format is supported.
Symbian CMdaAudioPlayerUtility is used. All formats that Symbian OS or devices support are supported also by Qt.

landlord can try to sound resource converted to wav format to use. If you must use the mp3 on the use of other types of bars , QSound not do
------ eference -------------------------- -------------

Before
I can not play with the absolute path , issued only beep is heard .
If you want to play the voice of the resources
, what to use it?
------ eference --------------------------------------- < br> Qt version there are many online mp3 player , you can download point look .
before seen others use Phonon decode mp3
------ eference ---------------------------- -----------


I found sound.isAvailable pass the test ( ) returns false, the help system is no corresponding device , which should how to solve ah ?
Whether mp3 or WAV can not put ah.
------ eference --------------------------------------- < br> online search , or use the phonon solve it
------ eference -------------------------- -------------


wav format I have tested successfully .
------ eference --------------------------------------- < br> code which will not be a problem
------ eference ------------------------------ ---------


Thank you for your reply , I still use the phonon do it.
------ eference --------------------------------------- < br> QSound can not play much of a wav, small files did not ask

没有评论:

发表评论