What is the easiest way to read wav-files using Python [summary]?

后端 未结 8 670
夕颜
夕颜 2020-12-09 13:13

I want to use Python to access a wav-file and write its content in a form which allows me to analyze it (let\'s say arrays).

  1. I heard that \"audiolab\" is a sui
8条回答
  •  温柔的废话
    2020-12-09 13:44

    audiolab seems to be not maintained anymore, you should try PySoundFile.

    Installation is simple:

    pip install PySoundFile --user
    

    And reading a sound file as well:

    import soundfile as sf
    x, fs = sf.read('/usr/share/sounds/purple/receive.wav')
    

    Have a look at this overview about different Python libraries for handling sound files.

提交回复
热议问题