MP3的可视化 - PHP [英] Visualization of MP3 - PHP

查看:206
本文介绍了MP3的可视化 - PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个MP3播放器使用JavaScript(和任何插件/框架(jQuery的)/库,相关)及我的网站; HTML5。所以我建了播放器(更准确地说,我实现jPlayer),现在我想打一个可视化工具。

I'm trying to build an mp3 player for my site using JavaScript (and any plugins/frameworks(jQuery)/libraries that are relevant) & html5. So I built the player (more accurately, I implemented jPlayer), and now I want to make a visualizer.

好吧,也许它不是一个可视化(所有办法来可视化的声音一直困惑我的名字),我想我要的是这样的事情(更新:我刚刚发现这就是所谓的的waveform ):

wavelenghth

或者只是一些图表的MP3的振幅(响度)。

我已经告诉我的can't做到这一点与JavaScript

因此,没有人知道如何使用PHP?做

更准确的说,没有人知道如何以图形使用PHP MP3的音量/幅度?我知道,一旦我得到的响度我可以做一个图形使用GD或谷歌图表API图片

More accurately, does anyone know how to graph the loudness/amplitude of an MP3 using PHP? I know that once I get the loudness I can make a graph using GD or the Google graphs image API.

所有的API,思路,框架都将是多少AP preciated!

Any API's, ideas, frameworks will all be much appreciated!

推荐答案

您不利用PHP来调出命令行工具在系统上?如果没有,那么我会建议使用 mpg123的来的MP3暂时为.wav,然后一个叫做效用的 wav2png.py 生成波形为.png图像。

Are you adverse to using PHP to call out to command line tools on the system? If not, then I would suggest using mpg123 to convert the mp3 temporarily to .wav, and then a utility called wav2png.py to generate the waveform as a .png image.

这将是缓慢的,占用内存和磁盘饿了,因为它需要先转换为.wav。

This is going to be slow, memory-hungry, and disk-hungry, since it requires conversion to .wav first.

exec("mpg123 -w outfile.wav infile.mp3");

// Not sure of the syntax for wav2png...
exec("wav2png.py outfile.wav");

免责声明:我有没有wave2png.py经验,且只知道它的存在

这篇关于MP3的可视化 - PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆