Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-65207

Audiocapture plugin: cannot set 24 bit audio bit depth in audio encoder

    XMLWordPrintable

Details

    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

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes