diff options
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo.cpp | 14 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 5 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioformat.cpp | 28 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_win32_p.cpp | 5 |
4 files changed, 40 insertions, 12 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index ca20eda..1bddb20 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -105,7 +105,7 @@ public: The values supported by the the device for each of these parameters can be fetched with - supportedByteOrders(), supportedChannels(), supportedCodecs(), + supportedByteOrders(), supportedChannelCounts(), supportedCodecs(), supportedSampleRates(), supportedSampleSizes(), and supportedSampleTypes(). The combinations supported are dependent on the platform, audio plugins installed and the audio device capabilities. If you need a specific format, you can check if @@ -268,7 +268,11 @@ QList<int> QAudioDeviceInfo::supportedSampleRates() const } /*! - \internal + \obsolete + + Use supportedSampleRates() instead. + + Returns a list of supported frequencies. */ QList<int> QAudioDeviceInfo::supportedFrequencies() const @@ -286,7 +290,11 @@ QList<int> QAudioDeviceInfo::supportedChannelCounts() const } /*! - \internal + \obsolete + + Use supportedChannelCount() instead. + + Returns a list of supported channels. */ QList<int> QAudioDeviceInfo::supportedChannels() const diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp index 373e23d..e71e88d 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -94,16 +94,15 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const { QAudioFormat nearest; if(mode == QAudio::AudioOutput) { - nearest.setSampleRate(44100); + nearest.setFrequency(44100); nearest.setChannelCount(2); nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(16); nearest.setCodec(QLatin1String("audio/pcm")); } else { - nearest.setSampleRate(11025); + nearest.setFrequency(11025); nearest.setChannelCount(1); - nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(8); nearest.setCodec(QLatin1String("audio/pcm")); diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index 58bb571..4544a73 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -111,7 +111,7 @@ public: \o Parameter \o Description \row - \o Frequency + \o Sample Rate \o Samples per second of audio data in Hertz. \row \o Number of channels @@ -143,7 +143,7 @@ public: Values are initialized as follows: \list - \o frequency() = -1 + \o sampleRate() = -1 \o channelCount() = -1 \o sampleSize() = -1 \o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder) @@ -233,7 +233,11 @@ void QAudioFormat::setSampleRate(int samplerate) } /*! - \internal + \obsolete + + Use setSampleRate() instead. + + Sets the frequency to \a frequency Hertz. */ void QAudioFormat::setFrequency(int frequency) @@ -251,7 +255,11 @@ int QAudioFormat::sampleRate() const } /*! - \internal + \obsolete + + Use sampleRate() instead. + + Returns the current frequency in Hertz. */ int QAudioFormat::frequency() const @@ -269,7 +277,11 @@ void QAudioFormat::setChannelCount(int channels) } /*! - \internal + \obsolete + + Use setChannelCount() instead. + + Sets the no. of channels to \a channels. */ void QAudioFormat::setChannels(int channels) @@ -287,7 +299,11 @@ int QAudioFormat::channelCount() const } /*! - \internal + \obsolete + + Use channelCount() instead. + + Returns the no. of channels. */ int QAudioFormat::channels() const diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index 5c597ef..dfbe2ec 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -230,6 +230,11 @@ bool QAudioInputPrivate::open() } else { period_size = buffer_size/5; } +#ifdef Q_OS_WINCE + // For wince reduce size to 40ms for buffer size and 20ms period + buffer_size = settings.sampleRate()*settings.channelCount()*(settings.sampleSize()/8)*0.04; + period_size = buffer_size/2; +#endif timeStamp.restart(); elapsedTimeOffset = 0; wfx.nSamplesPerSec = settings.sampleRate(); |