mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 07:35:12 -04:00
fixed small issues.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5596 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
181983be10
commit
c5a5c1654f
3 changed files with 27 additions and 15 deletions
|
@ -5,7 +5,8 @@ AudioDeviceHelper::AudioDeviceHelper()
|
|||
{
|
||||
}
|
||||
|
||||
QAudioInput* AudioDeviceHelper::getDefaultInputDevice() {
|
||||
QAudioInput* AudioDeviceHelper::getDefaultInputDevice()
|
||||
{
|
||||
QAudioFormat fmt;
|
||||
fmt.setFrequency(16000);
|
||||
fmt.setChannels(1);
|
||||
|
@ -15,10 +16,11 @@ QAudioInput* AudioDeviceHelper::getDefaultInputDevice() {
|
|||
fmt.setCodec("audio/pcm");
|
||||
|
||||
QAudioDeviceInfo it, dev;
|
||||
QList<QAudioDeviceInfo> input_list = QAudioDeviceInfo::availableDevices(QAudio::AudioInput) ;
|
||||
|
||||
dev = QAudioDeviceInfo::defaultInputDevice();
|
||||
if (dev.deviceName() != "pulse") {
|
||||
foreach(it, QAudioDeviceInfo::availableDevices(QAudio::AudioInput)) {
|
||||
foreach(it, input_list) {
|
||||
if(it.deviceName() == "pulse") {
|
||||
dev = it;
|
||||
qDebug("Ok.");
|
||||
|
@ -27,7 +29,7 @@ QAudioInput* AudioDeviceHelper::getDefaultInputDevice() {
|
|||
}
|
||||
}
|
||||
if (dev.deviceName() == "null") {
|
||||
foreach(it, QAudioDeviceInfo::availableDevices(QAudio::AudioInput)) {
|
||||
foreach(it, input_list) {
|
||||
if(it.deviceName() != "null") {
|
||||
dev = it;
|
||||
break;
|
||||
|
@ -50,10 +52,13 @@ QAudioOutput* AudioDeviceHelper::getDefaultOutputDevice() {
|
|||
fmt.setByteOrder(QAudioFormat::LittleEndian);
|
||||
fmt.setCodec("audio/pcm");
|
||||
|
||||
QList<QAudioDeviceInfo> list_output = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput) ;
|
||||
|
||||
QAudioDeviceInfo it, dev;
|
||||
dev = QAudioDeviceInfo::defaultOutputDevice();
|
||||
|
||||
if (dev.deviceName() != "pulse") {
|
||||
foreach(it, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
|
||||
foreach(it, list_output) {
|
||||
if(it.deviceName() == "pulse") {
|
||||
dev = it;
|
||||
break;
|
||||
|
@ -61,7 +66,7 @@ QAudioOutput* AudioDeviceHelper::getDefaultOutputDevice() {
|
|||
}
|
||||
}
|
||||
if (dev.deviceName() == "null") {
|
||||
foreach(it, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
|
||||
foreach(it, list_output) {
|
||||
if(it.deviceName() != "null") {
|
||||
dev = it;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue