Thanks for the reply Andrew!

That helps a lot. I did notice that QSoundEffect is initializing it's category 
to the string "game" and that it is managed by the Media stream volume on 
Android. That string is obviously different than the one being used by 
QAudioOutput which is probably why you're seeing different behavior.

We can try to switch to QAudioOutput in the meantime. Thanks again!
Corey

-----Original Message-----
From: Andrew Knight [mailto:[email protected]]
Sent: Saturday, November 07, 2015 2:45 AM
To: Pendleton, Corey <[email protected]>; [email protected]
Subject: Re: [Interest] QSoundEffect Categories on Android

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

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of 
the intended recipient(s) and contain information that may be confidential 
and/or legally privileged. If you have received this email in error, please 
notify the sender by reply email and delete the message. Any disclosure, 
copying, distribution or use of this communication (including attachments) by 
someone other than the intended recipient is prohibited. Thank you.
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to