How to edit raw PCM audio data without an audio library?

后端 未结 5 683
囚心锁ツ
囚心锁ツ 2020-12-16 04:00

I\'m interested in precisely extracting portions of a PCM WAV file, down to the sample level. Most audio modules seem to rely on platform-specific audio libraries. I want

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 04:33

    I read the question and the answers and I feel that I must be missing something completely obvious, because nobody mentioned the following two modules:

    • audioop: manipulate raw audio data
    • wave: read and write WAV files

    Perhaps I come from a parallel universe and Guido's time machine is actually a space-time machine :)

    Should you need example code, feel free to ask.

    PS Assuming 48kHz sampling rate, a video frame at 24/1.001==23.976023976… fps is 2002 audio samples long, and at 25fps it's 1920 audio samples long.

提交回复
热议问题