Play sound
-
I needed to play short sound (1-3 sec) from url
I used QSoundEffect
@QSoundEffect* player = new QSoundEffect;
player->setSource(QUrl("http://translate.google.ru/translate_tts?ie=UTF-8&tl=en&prev=input&q=" + word));
player->setVolume(1.0f);
player->play();@File loaded correctly, but was not played and i got QSoundEffect(qaudio): Error decoding source
I used so QMediaPlayer. There is no loading was performed and was wrote "no service found for org.qt-project.qt.mediaplayer"
-
Hi,
Please don't bump your own thread in such a short interval, allow at least 24 to 72 hours.
That said, are you sure your URL gives you valid audio data ?
-
U can check too. Link for example: http://translate.google.com/translate_tts?ie=UTF-8&tl=en&prev=input&q=hello
-
Maybe use the resource file to do this, or to be sure the URL is valid, use a qfiledialog to ask the user what sound to play. In the debugger analyze the given path+name. there might be a difference there. Usually it's not the Qt class that malfunctions, but the information provided
-
so, first test with a local file (via qfiledialog), then the local file without the dialog, then the URL way?
-
-
What OS/Qt version are you using ?
-
Might be a limitation of the multimedia backend on windows... I tried a wav file on OS X and it's working fine but not using the link you provided.
-
Well... Just reading a local wav file should not be a problem. Did you check the "bug report system":https://bugreports.qt-project.org/ to see if this is something known ? You might consider creating a bug report (put as much details as you can and a minimal compilable example so it can be reproduced)
You can also start by asking on the interest mailing list, You'll find Qt's developers/maintainers there (this forum is more user oriented)