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

更新audio manager

This commit is contained in:
tianduanrui 2018-02-10 19:11:01 +08:00
parent 5ff3e0ad41
commit acbb62105d
2 changed files with 15 additions and 1 deletions

View File

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

View File

@ -9,7 +9,7 @@ int main ( int argc, char* argv[] )
MainWindow w;
w.show();
moveFull ( &w );
w.showMaximized();
return a.exec();
}