Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10.0
-
Audiocapture plugin
Description
It is not possible to record 24 bit audio with QAudioRecorder when using audiocapture plugin, because when QAudioEncoderSettings are used to define QAudioFormat the sampleSize is set to either 8 or 16 - almost regardless of the values in QAudioEncoderSettings. See qtmultimedia/src/plugins/audiocapture/audioencodercontrol.cpp, audioSettingsToAudioFormat() function.
This can be tested with Qt Example Audio Recorder by setting QAudioEncoderSettings to:
settings.setCodec("audio/pcm");
settings.setSampleRate(48000);
settings.setBitRate(1152000);
settings.setChannelCount(1);
This should lead to QAudioFormat.sampleSize = 24 (formula is [bit rate] = [bit depth] * [sample rate] * [channel count]). But checking the properties of the output file, the bit depth seems to be 16.
A quick and dirty try to force the sampleRate to 24 gives correct results. Thus recording with 24 bit seems to work if you'd be able to set it. And also, there are more depths than 24 bit available. Thus a more general solution would be preferred.
Attachments
For Gerrit Dashboard: QTBUG-65207 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
214602,5 | Audiocapture: Fix setting QAudioEncoderSettings::bitRate | 5.11 | qt/qtmultimedia | Status: MERGED | +2 | 0 |