如何在Linux中创建MP3的波形图?
发布时间:2021-01-11 20:22:05 所属栏目:Linux 来源:互联网
导读:给定一个MP3,我想将文件中的波形解压缩成一个图像(.png) 有没有一个可以做我需要的包? 使用sox和gnuplot可以创建基本的波形图像: sox audio.mp3 audio.dat #create plaintext file of amplitude valuestail -n+3 audio.dat audio_only.dat #remove comments
|
给定一个MP3,我想将文件中的波形解压缩成一个图像(.png) 有没有一个可以做我需要的包? 解决方法使用sox和gnuplot可以创建基本的波形图像:sox audio.mp3 audio.dat #create plaintext file of amplitude values tail -n+3 audio.dat > audio_only.dat #remove comments # write script file for gnuplot echo set term png size 320,180 > audio.gpi #set output format echo set output "audio.png" >> audio.gpi #set output file echo plot "audio_only.dat" with lines >> audio.gpi #plot data gnuplot audio.gpi #run script 要创建更简单/更漂亮的东西,请使用以下GNU Plot文件作为模板(将其保存为audio.gpi): #set output format and size set term png size 320,180 #set output file set output "audio.png" # set y range set yr [-1:1] # we want just the data unset key unset tics unset border set lmargin 0 set rmargin 0 set tmargin 0 set bmargin 0 # draw rectangle to change background color set obj 1 rectangle behind from screen 0,0 to screen 1,1 set obj 1 fillstyle solid 1.0 fillcolor rgbcolor "#222222" # draw data with foreground color plot "audio_only.dat" with lines lt rgb 'white' 并运行: sox audio.mp3 audio.dat #create plaintext file of amplitude values tail -n+3 audio.dat > audio_only.dat #remove comments gnuplot audio.gpi #run script 基于this answer的一个类似的问题,对于文件格式而言更为普遍,但对于使用的软件则不太一般. (编辑:南阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux diff(differential) 命令
- linux – 为什么gcc在调用“main”之后在程序中放置一个“h
- linux脚本与netcat在x小时后停止工作
- linux – 新节点配置中缺少“通过Java Web Start启动从属代
- linux – vim命令中的转义字符
- linux – 如何阻止在远程主机上分支
- linux – [01000] [unixodBC] [Driver Manager]无法打开lib
- AIX 5.3(ld-xlc)等效选项Linux(ld-gcc)-rpath
- 2014-03-10 09:14
- 在Redhat Enterprise Server上安装python-ldap时解决GCC错误
