kopia lustrzana https://gitlab.com/eliggett/wfview
Try readyRead instead of notify
rodzic
7bf2f54255
commit
09ea7a2c26
|
@ -145,13 +145,13 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
|
||||
if (setup.isinput) {
|
||||
audioInput = new QAudioInput(setup.port, format, this);
|
||||
audioInput->setNotifyInterval(setup.blockSize);
|
||||
//audioInput->setNotifyInterval(setup.blockSize);
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Starting audio timer";
|
||||
|
||||
//audioTimer = new QTimer();
|
||||
//audioTimer->setTimerType(Qt::PreciseTimer);
|
||||
//connect(audioTimer, &QTimer::timeout, this, &audioHandler::getNextAudioChunk);
|
||||
connect(audioInput, SIGNAL(notify()), this, SLOT(getNextAudioChunk()),Qt::DirectConnection);
|
||||
//connect(audioInput, SIGNAL(notify()), this, SLOT(getNextAudioChunk()),Qt::DirectConnection);
|
||||
|
||||
connect(audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(stateChanged(QAudio::State)));
|
||||
}
|
||||
|
@ -211,9 +211,9 @@ void audioHandler::start()
|
|||
if (setup.isinput) {
|
||||
audioDevice = audioInput->start();
|
||||
connect(audioInput, &QAudioInput::destroyed, audioDevice, &QIODevice::deleteLater, Qt::UniqueConnection);
|
||||
//connect(audioDevice, &QIODevice::readyRead, this, &audioHandler::getNextAudioChunk);
|
||||
connect(audioDevice, &QIODevice::readyRead, this, &audioHandler::getNextAudioChunk);
|
||||
//audioTimer->start(setup.blockSize);
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Notify interval set to" << audioInput->notifyInterval() << "requested" << setup.blockSize;
|
||||
//qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Notify interval set to" << audioInput->notifyInterval() << "requested" << setup.blockSize;
|
||||
}
|
||||
else {
|
||||
// Buffer size must be set before audio is started.
|
||||
|
|
Ładowanie…
Reference in New Issue