Details
-
Bug
-
Resolution: Done
-
P2: Important
-
1.2.0
-
None
-
3332f36fca5bc6c5f1cc4c6fed4c24ff7203687c
Description
STEPS LEADING TO PROBLEM:
QAudioInput audioInput(testFormats.at(i), this);
audioInput.setNotifyInterval(100);
QSignalSpy stateSignal(&audioInput, SIGNAL(stateChanged(QAudio::State)));
QVERIFY(stateSignal.count()== 0);
QVERIFY(audioInput.bytesReady() == 0);
QVERIFY(audioInput.state() == QAudio::StoppedState);
audioInput.start();
QTest::qWait(500);
QVERIFY(stateSignal.count() == 1);
QVERIFY(audioInput.bytesReady() > 0);
QVERIFY(audioInput.state() == QAudio::IdleState);
audioInput.reset();
QTest::qWait(500);
QVERIFY(stateSignal.count()== 1);
QVERIFY(audioInput.bytesReady() == 0);
QVERIFY(audioInput.state() == QAudio::IdleState);
EXPECTED OUTCOME:
reset() api should reset the state of audioInput and emit the stateChanged()
signal.
ACTUAL OUTCOME:
reset() api is resetting the bytesReady to 0 , but the state is still same and
stateChanged() signal not getting generated.
Documentation says:
reset() api drops all audio data in the buffers, resets buffers to zero.
You can request a state change directly through suspend(), resume(), stop(),
reset(), and start().