0

I need to record 24-bit audio using python, and I try pyaudio to do that. However, it seems that pyaudio doesn't support 24-bit recording.

I set the format to 24-bit(pyaudio.paInt24), it record and save as a 24-bit file. However, it's not a true 24-bit recording. I plot the wave signal and found that it's just 16-bit precision but zero-padding to 24-bit.

Could anyone tell me how to record true 24-bit audio with python? Thanks

1 Answers1

0

PyAudio is able in record in 24-bit, all that you need to do is put an pyaudio.paInt24 in your formant type.

import pyaudio
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paInt24,
                    channels=1,
                    rate=44100,
                    input=True,
                    frames_per_buffer=1024)
ederwander
  • 3,410
  • 1
  • 18
  • 23