[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QAudioRecorder settings not correct in recorded .wav file
From:       Colin McPhail <colin.mcphail () mac ! com>
Date:       2018-04-26 15:53:48
Message-ID: B007E2D7-04EB-44B4-869E-52BC60667D56 () mac ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

> On 26 Apr 2018, at 12:13, Alex Tu <alex_tu@gmx.de> wrote:
> 
> 
> Hey everyone,
> I'm using the QAudioRecorder to record some audio to do some speech recognition.
> The sample rate of the output should be 16kHz.
> My settings look like this:
> 
> settings = QAudioEncoderSettings()
> settings.setCodec(self.supportedAudioCodecs()[0])
> settings.setBitRate(32000)
> settings.setSampleRate(16000)
> settings.setChannelCount(1)
> settings.setQuality(QMultimedia.VeryHighQuality)
> recorder.setAudioSettings(settings)
> // recorder.setEncodingSettings(self.settings) # Tried this as well, but no luck \
> here either 
> But checking the recorded .wav file with Audacity, the sample rate is always 96kHz \
> and the bitrate is 192k instead of the 32k.

What happens if you add      \
settings.setEncodingMode(QMultimedia.ConstantBitRateEncoding) to your setup?

— Colin


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
line-break: after-white-space;" class="">Hi,<br class=""><div><br \
class=""><blockquote type="cite" class=""><div class="">On 26 Apr 2018, at 12:13, \
Alex Tu &lt;<a href="mailto:alex_tu@gmx.de" class="">alex_tu@gmx.de</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br \
class="">Hey everyone,<br class="">I'm using the QAudioRecorder to record some audio \
to do some speech recognition.<br class="">The sample rate of the output should be \
16kHz.<br class="">My settings look like this:<br class=""><br \
class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; settings = QAudioEncoderSettings()<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
settings.setCodec(self.supportedAudioCodecs()[0])<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.setBitRate(32000)<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.setSampleRate(16000)<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.setChannelCount(1)<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
settings.setQuality(QMultimedia.VeryHighQuality)<br class="">&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; recorder.setAudioSettings(settings)<br class="">&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; // recorder.setEncodingSettings(self.settings) # Tried this as \
well, but no luck here either<br class=""><br class="">But checking the recorded .wav \
file with Audacity, the sample rate is always 96kHz and the bitrate is 192k instead \
of the 32k.<br class=""></div></div></blockquote><br class=""></div><div><font \
face="Courier New" class="">What happens if you add &nbsp; &nbsp; \
&nbsp;settings.setEncodingMode(QMultimedia.ConstantBitRateEncoding)</font></div><div><font \
face="Courier New" class="">to your setup?</font></div><br class=""><div class="">— \
Colin</div></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic