PDA

View Full Version : QAudioDeviceInfo finds no default audio device on Android



jeggu
22nd July 2016, 05:36
I have created a simple player application using QAudioOutput. it is working fine.

Later i moved player code to separate project and built it as shared library and creating player object in my application.

But QAudioDeviceInfo::availableDevices(QAudio::AudioOu tput)) returning empty list

i have verified deployment package. it has multimedia dependencies

Code:

QAudioFormat audioFormat;
audioFormat.setSampleRate(44100);
audioFormat.setChannelCount(2);
audioFormat.setSampleSize(16);
audioFormat.setCodec("audio/pcm");
audioFormat.setByteOrder(QAudioFormat::LittleEndia n);
audioFormat.setSampleType(QAudioFormat::SignedInt) ;
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
if (!info.isFormatSupported(audioFormat))
{
throw myexception("Can not play audio due to unsupported format");
}

Then i have created one more shared library it have a simple class inside the constructor i calling above code its working but when i include complete code it is not working

what might be the reason

settings:

qt5.5

andriod ndk12

anda_skoa
22nd July 2016, 10:47
I assume the code above is in a class that is provided by the library, correct?

And you create an instance of that class in your main application?

Cheers,
_