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. AudioRecording Help
Forum Updated to NodeBB v4.3 + New Features

AudioRecording Help

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.1k 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.
  • aminnovA Offline
    aminnovA Offline
    aminnov
    wrote on last edited by
    #1

    Hello,
    When creating a voice application under reconnaissace QtCreator I want to add two buttons, one for voice recording of a microphone and one for stop and the voice is automatically saved in a .wav file I would like to know the source code and the library used to achieve this.
    it's urgent
    Thanks

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

      Hi and welcome to devnet,

      QAudioInput is your friend.

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

      aminnovA 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        QAudioInput is your friend.

        aminnovA Offline
        aminnovA Offline
        aminnov
        wrote on last edited by
        #3

        Thanx for reply
        I am a beginner in QtCreator, I want a complete function for recording if possible, in order to call this function by the button in the application.
        it's urgent please

        RatzzR 1 Reply Last reply
        0
        • aminnovA aminnov

          Thanx for reply
          I am a beginner in QtCreator, I want a complete function for recording if possible, in order to call this function by the button in the application.
          it's urgent please

          RatzzR Offline
          RatzzR Offline
          Ratzz
          wrote on last edited by
          #4

          @aminnov
          Here is one example.

          --Alles ist gut.

          1 Reply Last reply
          0
          • aminnovA Offline
            aminnovA Offline
            aminnov
            wrote on last edited by
            #5

            Thanx for reply
            I found a function in this site, and I paste in my code but an error servenu: QAudioInput :: No such file or directory?
            I searched this problem but I have not solved.
            the code is :

            QFile outputFile;         // class member.
            QAudioInput *audioInput;  // class member.
            ...
            void startRecording()
            {
                outputFile.setFileName("/tmp/test.raw");
                outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate );
                QAudioFormat format;
                // set up the format you want, eg.
                format.setFrequency(8000);
                format.setChannels(1);
                format.setSampleSize(8);
                format.setCodec("audio/pcm");
                format.setByteOrder(QAudioFormat::LittleEndian);
                format.setSampleType(QAudioFormat::UnSignedInt);
                QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
                if (!info.isFormatSupported(format)) {
                    qWarning()<<"default format not supported try to use nearest";
                    format = info.nearestFormat(format);
                }
                audioInput = new QAudioInput(format, this);
                QTimer::singleShot(3000, this, SLOT(stopRecording()));
                audioInput->start(&outputFile);
                // Records audio for 3000ms
            }
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Because you are missing QT += multimedia in your .pro file.

              On a side note, asking on a community forum for someone to do the work for you because it's urgent for you isn't exactly professional. If you are in such a hurry then consider hiring someone with the expertise you need.

              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