Solved Audio input device on Audio Recording
-
I have multiple of usb sound card connected to my system and i want to record one certain signal for each sound card. How will I call the name of my USB sound card to work properly.
audioRecorder->setAudioInput(); // this part is my question on how will i enter the name of my usb sound card
-
@KenoRosarioPH Thank you so much forums
-
Hi and welcome to devnet,
You can see how to do that in the details of QAudioRecorder's documentation as well as the linked example.
-
Thank you sir but ive been hovering the documentation for days and i really cant get something. Noob here sorry :( The documentation gives a dropdown list of my usb soundcard. What i am after sir is , i my self will manually assign my input device on my code without generating a drop down list. Thank you sir```
audioRecorder->setAudioInput(proper calling of my usb sound card) -
QString str1 = ui->lineEdit_8->text(); QString filename = str1 ; QString Nfile = "N"; QString Nfilename = filename + Nfile; audioRecorder = new QAudioRecorder(this); QAudioEncoderSettings audioSettings; audioSettings.setCodec("wav"); audioSettings.setQuality(QMultimedia::HighQuality); QString input1 = "Microphone (USB Pnp Sound Device)"; // part where i guess i have the wrong syntax to call my USB sound card audioRecorder->setAudioInput(input1); audioRecorder->setEncodingSettings(audioSettings); audioRecorder->setOutputLocation(QUrl::fromLocalFile(filename)); audioRecorder->record(); QString input2 = "USB Audio Device"; part where i guess i have the wrong syntax to call my USB sound card noiseRecorder = new QAudioRecorder(this); noiseRecorder->setAudioInput(input2); noiseRecorder->setEncodingSettings(audioSettings); noiseRecorder->setOutputLocation(QUrl::fromLocalFile(Nfilename)); noiseRecorder->record();
[edit: Fixed coding block SGaist]
-
If you want to hardcode that because you know what device you want to use. Use qDebug to print the values returned by
audioRecorder->audioInputs();
on the console and then use that to feed input1 and input2. -
@SGaist I seeem and i agree with you sir. But i cant get qDebug to work. I dont know how to print it. :(
-
Doesn't
qDebug() << audioRecorder->audioInputs();
work for you ? -
@SGaist Sir I already Got it! THANKYOU SO MUCHH!
-
You're welcome !
Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forums users may know that a solution has been found :)
Also, while browsing the forum, consider up-voting answers that helped you, this will make them easier to find for other forum users :)
-
@SGaist WORKS ALL FINE NOW SIR! YOUVE BEEN A CHANGER TO MY PROJECT SIR! TY
-
I had been trying to do something similar, and after searching for a number of solutions, i found out that such connected audio works require additional hardware and we have to use cbs all access login and password . happy to help!
-
Hi,
Can you give more details ?