1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

fix open audio fail tip.

This commit is contained in:
tianduanrui 2018-02-10 19:30:48 +08:00
parent acbb62105d
commit dcd91fb5b9

View File

@ -41,14 +41,14 @@ void QQtAudioManager::startInput()
{
stopInput();
mInputManager = new QAudioInput ( mInputDeviceInfo, mInputAudioFormat, this );
if ( QAudio::NoError != mInputManager->error() )
mInputDevice = mInputManager->start();
if ( !mInputDevice || QAudio::NoError != mInputManager->error() )
{
pline() << mInputDeviceInfo.deviceName() << mInputAudioFormat.sampleSize() << mInputAudioFormat.sampleRate() <<
mInputAudioFormat.channelCount() << "open failed, errcode:" << mInputManager->error();
delete mInputManager;
return;
}
mInputDevice = mInputManager->start();
connect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) );
}
@ -83,14 +83,14 @@ void QQtAudioManager::startOutput()
{
stopOutput();
mOutputManager = new QAudioOutput ( mOutputDeviceInfo, mOutputAudioFormat, this );
if ( QAudio::NoError != mOutputManager->error() )
mOutputDevice = mOutputManager->start();
if ( !mOutputDevice || QAudio::NoError != mOutputManager->error() )
{
pline() << mOutputDeviceInfo.deviceName() << mOutputAudioFormat.sampleSize() << mOutputAudioFormat.sampleRate() <<
mOutputAudioFormat.channelCount() << "open failed, errcode:" << mOutputManager->error();
delete mOutputManager;
return;
}
mOutputDevice = mOutputManager->start();
}
void QQtAudioManager::stopOutput()