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"
-
No ideas? :'(
-
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 ?
-
Ok, sorry
Yes i sure. I tried to use local file, but i got same error -
U can check too. Link for example: http://translate.google.com/translate_tts?ie=UTF-8&tl=en&prev=input&q=hello
-
24h waited
Up
I really need dicision. Maybe non-qt libs have those capabilities? I use only windows -
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?
-
No, i tried it. All time i see this error
-
Have you tried QMediaPlayer?
-
[quote author="AlterX" date="1377879730"]Have you tried QMediaPlayer?[/quote]
Yes, I wrote it in first post
[quote] I used so QMediaPlayer. There is no loading was performed and was wrote “no service found for org.qt-project.qt.mediaplayer”[/quote] -
What OS/Qt version are you using ?
-
WinXp, qt5.1
-
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.
-
Awww, why i got in touch with qt... :D nothing is not working correctly, or i doing something wrong?
-
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)
-
I have the same problem on BeagleboneBlack.
Everything works great in ubuntu on Desktop. but i receive "no service found for org.qt-project.qt.mediaplayer" error on beaglebone board.how did you solve this problem?