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

后端 未结 5 678
囚心锁ツ
囚心锁ツ 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条回答
  •  遥遥无期
    2020-12-16 04:22

    I was looking this up and I found this: http://www.swharden.com/blog/2009-06-19-reading-pcm-audio-with-python/ It requires Numpy (and matplotlib if you want to graph it)

    import numpy
    data = numpy.memmap("test.pcm", dtype='h', mode='r')
    print "VALUES:",data
    

    Check out the original author's site for more details.

提交回复
热议问题