[Interest] QSoundEffect Categories on Android
Andrew Knight
andrew.knight at intopalo.com
Sat Nov 7 09:44:59 CET 2015
Hi Corey,
On 11/07/2015 12:50 AM, Pendleton, Corey wrote:
> Does anyone have ANY information on how to use the category property of QSoundEffect on the Android platform? My hope is that somewhere strings map to Android audio streams, but I can't find it anywhere in the documentation or online, and I also can't find the platform specific implementation for Android.
Qt audio categories do map to Android audio streams (see
http://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/plugins/opensles/qopenslesaudiooutput.cpp#n297)
- the platform-specific bits are in the OpenSL ES plugin, which is a
different backend than used for e.g. QMediaPlayer on Android. For
sending to the notification stream, for example, set the category to
"notification". This works for me using QAudioOutput, which also has a
category property.
That said, YMMV. I just tested this with QSoundEffect in Qt 5.5.1 and
wasn't able to play a WAV (it works on Linux desktop w/ pulseaudio). The
playback clearly through the same opensles engine, but fails when trying
to create the OpenSL ES AudioPlayer
(http://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/plugins/opensles/qopenslesaudiooutput.cpp#n462).
I guess I'll need to debug a bit in there, as the engine doesn't print
the return code of that OpenSL call.
So, my recommendation would be to avoid QSoundEffect and use
QAudioOutput if you can. I will follow up on the issue and report a bug
or submit a fix if I find one.
HTH,
Andrew
More information about the Interest
mailing list