mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
更新audio manager
This commit is contained in:
parent
5ff3e0ad41
commit
acbb62105d
@ -41,6 +41,13 @@ void QQtAudioManager::startInput()
|
|||||||
{
|
{
|
||||||
stopInput();
|
stopInput();
|
||||||
mInputManager = new QAudioInput ( mInputDeviceInfo, mInputAudioFormat, this );
|
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();
|
mInputDevice = mInputManager->start();
|
||||||
connect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) );
|
connect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) );
|
||||||
}
|
}
|
||||||
@ -76,6 +83,13 @@ void QQtAudioManager::startOutput()
|
|||||||
{
|
{
|
||||||
stopOutput();
|
stopOutput();
|
||||||
mOutputManager = new QAudioOutput ( mOutputDeviceInfo, mOutputAudioFormat, this );
|
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();
|
mOutputDevice = mOutputManager->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ int main ( int argc, char* argv[] )
|
|||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
moveFull ( &w );
|
w.showMaximized();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user