In QT I can define an Audio input as:
m_audioInput = new QAudioInput(m_Inputdevice, m_format, this);
m_input = m_audioInput->start();
In my application I would like to use a mic and read from audio card.
Now if I want to see how many bytes are ready to read from Audio buffer I use:
qint64 len = m_audioInput->bytesReady();
It looks like the len is a function of sampling rate and number of bits per sample.
My question is that is there a way to control len, without changing the sampling rate? In other words I would like to control the audio card such that it reads data in shorter blocks and emits the ready signal.
You can control the audio card by setting up proper format parameters e.g., frequency, sample size. For this you need to use
QAudioFormatclass.Other than this, there is no other way to control audio card from Qt.
Class Reference.
Example from the reference: