Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Audio input device on Audio Recording
Forum Updated to NodeBB v4.3 + New Features

Audio input device on Audio Recording

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KenoRosarioPH
    wrote on last edited by
    #4

    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)

    1 Reply Last reply
    0
    • SGaistS SGaist

      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.

      K Offline
      K Offline
      KenoRosarioPH
      wrote on last edited by SGaist
      #5

      @SGaist

      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]

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        K 2 Replies Last reply
        0
        • SGaistS 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.

          K Offline
          K Offline
          KenoRosarioPH
          wrote on last edited by
          #7

          @SGaist I seeem and i agree with you sir. But i cant get qDebug to work. I dont know how to print it. :(

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #8

            Doesn't qDebug() << audioRecorder->audioInputs(); work for you ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            K 1 Reply Last reply
            1
            • SGaistS 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.

              K Offline
              K Offline
              KenoRosarioPH
              wrote on last edited by
              #9

              @SGaist Sir I already Got it! THANKYOU SO MUCHH!

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                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 :)

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • SGaistS SGaist

                  Doesn't qDebug() << audioRecorder->audioInputs(); work for you ?

                  K Offline
                  K Offline
                  KenoRosarioPH
                  wrote on last edited by
                  #11

                  @SGaist WORKS ALL FINE NOW SIR! YOUVE BEEN A CHANGER TO MY PROJECT SIR! TY

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    scofficial902
                    wrote on last edited by scofficial902
                    #12

                    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!

                    https://sc-downloader.net/

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      Hi,

                      Can you give more details ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved