简体   繁体   中英

How to play Audio file in Android QT?

i developed my application in QT, i am trying to port for android. my application working fine in android with few issues. the main issue is, i am not able to play the audio file when i am trying to put the audio file play Code i am getting error

QSound::play(FilePath);

Error: : -1: error: error: cannot find -lQtMultimediaKit D:\\Projects\\test\\demo.cpp:996: error: undefined reference to 'QSound::play(QString const&)'

my config: QT 4.8,QT Creator 2.5.83 and necessitas and windows XP

i am able to include the QSound Header file and using intellisense to type the QSound::Play no issue while typing when i am getting error on compilation. so i tried to look into the source folder and i found QSound.h header also.

How to play the Audio file in Android using QT?

in may case it works properly with no errors my code:

player->setMedia(QUrl("qrc:/new/prefix1/1.mp3"));    
// ok it works on windows  
//also works on android

在搜索信息时迷迷糊糊地发现了这一点,这看起来很有用: http : //qt-project.org/doc/qt-5/qml-qtmultimedia-mediaplayer.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM