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 buffer - Trying to access Audio Input on a sample by sample basis
QtWS25 Last Chance

Audio Input buffer - Trying to access Audio Input on a sample by sample basis

Scheduled Pinned Locked Moved Unsolved General and Desktop
qaudioinputaudiobuffer
2 Posts 2 Posters 1.2k Views
  • 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.
  • S Offline
    S Offline
    SamSpreadborough
    wrote on last edited by SamSpreadborough
    #1

    Hey everyone.
    I'm new to Qt; trying it out from having previously used JUCE.

    I'm trying to set up a simple audio input buffer of samples that I can access.
    In JUCE you'd set up the audio device, and then access the input buffer via an audio callback:

    void audioDeviceCallback (const float** inputChannelData, int numSamples)
    {
    const float *inL = inputChannelData[0];
    const float *inR = inputChannelData[1];

    while (numSamples --)
    {
    

    doSomething();

        inL++;
        inR++;
    }
    

    }

    I've tried to get Qt set up in a similar fashion, but I've as yet been unsuccessful. The documentation refers only to recording to a file using QAudioInput from what I could see.

    Can anyone offer any advice?

    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 returns a pointer to a QIODevice that will provide the audio data. Connect the readyRead signal from that QIODevice object to a slot of your class, there you can read the audio data received and make what you want with it.

      Hope it helps

      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
      1

      • Login

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