119 |
119 |
120 A QAudioDeviceInfo is used by Qt to construct |
120 A QAudioDeviceInfo is used by Qt to construct |
121 classes that communicate with the device--such as |
121 classes that communicate with the device--such as |
122 QAudioInput, and QAudioOutput. The static |
122 QAudioInput, and QAudioOutput. The static |
123 functions defaultInputDevice(), defaultOutputDevice(), and |
123 functions defaultInputDevice(), defaultOutputDevice(), and |
124 deviceList() let you get a list of all available |
124 availableDevices() let you get a list of all available |
125 devices. Devices are fetch according to the value of mode |
125 devices. Devices are fetch according to the value of mode |
126 this is specified by the QAudio::Mode enum. |
126 this is specified by the QAudio::Mode enum. |
127 The QAudioDeviceInfo returned are only valid for the QAudio::Mode. |
127 The QAudioDeviceInfo returned are only valid for the QAudio::Mode. |
128 |
128 |
129 For instance: |
129 For instance: |
130 |
130 |
131 \code |
131 \code |
132 foreach(const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput)) |
132 foreach(const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) |
133 qDebug() << "Device name: " << deviceInfo.deviceName(); |
133 qDebug() << "Device name: " << deviceInfo.deviceName(); |
134 \endcode |
134 \endcode |
135 |
135 |
136 In this code sample, we loop through all devices that are able to output |
136 In this code sample, we loop through all devices that are able to output |
137 sound, i.e., play an audio stream in a supported format. For each device we |
137 sound, i.e., play an audio stream in a supported format. For each device we |