开发者

Generate a waveform image from an audio file

开发者 https://www.devze.com 2023-01-04 19:21 出处:网络
Building a python application that converts raw audio files into wave using sox on a linux system. I want it to be able to generate an image (PNG or Jpeg) of the audio waveform pattern but I am unable

Building a python application that converts raw audio files into wave using sox on a linux system. I want it to be able to generate an image (PNG or Jpeg) of the audio waveform pattern but I am unable to find a command line tool or python package that will do this. Not being an experience Python programmer my options are limited.

There are several linux applications available that require a running desktop (Gtk) which I do not have. These are useless. http://www.baudline.com http://qu开发者_高级运维ickplot.sourceforge.net/

GnuPlot and Octave seem to only be able to produce spectrograph's which is not what I am trying to do.

Any ideas?


If you can get the raw audio data as a list of numbers, you can use matplotlib to draw your waveform as a chart. The code would look something like this:

matplotlib.pyplot.plot(raw_audio_data)
0

精彩评论

暂无评论...
验证码 换一张
取 消