How can I create a waveform image of an MP3 in Linux?

前端 未结 7 1101
旧时难觅i
旧时难觅i 2021-02-01 21:03

Given an MP3 I would like to extract the waveform from the file into an image (.png)

Is there a package that can do what I need ?

7条回答
  •  醉梦人生
    2021-02-01 21:33

    I would do something like this :

    • find a tool to convert mp3 to PCM, ie binary data with one 8 or 16 bit value per sample. I guess mplayer can do that

    • pipe the result to a utility converting binary data to an ascii representation of the numbers in decimal format

    • use gnuplot to transform this list of value into a png graph.

    And voilà, the power of piping between unix tools. Now Step 2 in this list might be optionnal if gnuplot is able to read it's data from a binary format.

提交回复
热议问题