Unsolved Pass QAudioDeviceInfo as parameter in Qml
-
Dear Friend :
how can I pass QAudioDeviceInfo as a parameter in slot in qml?
In fact I want using microphone of my device for taking or recording any voice.
I read QT QAudioinput sample and I want use this code in QML.this is my code in C++ :
void AudioInput::testslot(const QAudioDeviceInfo &deviceInfo){//do something}this is QML :
import audioqml 1.0 //module c++ written by myselft
AudioInput{
id:tst} Button{ id:btn text:"click me audio start" onClicked: tst.testslot() }
how can I handle this challenge?
-
Hi,
What information do you need from QAudioDeviceInfo ?
-
@SGaist : I just want take any voice in microphone , I want take any voice from microphone
-
So you just want your application user to be able to select the correct audio input ?
-
@SGaist : Yes , I want detect any voice or audio input in my application
-
Then create a small class that will provide the list of available audio input names to your QML code and base your selection on that. That will be way simpler than trying to path QAudioDeviceInfo.