在JavaScript中波形可视化从音乐 [英] Waveform visualization in JavaScript from audio

查看:470
本文介绍了在JavaScript中波形可视化从音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用JavaScript来显示的波形和音频文件,但我甚至不知道如何开始。我发现音频数据API 的,但我不熟悉大多数的音频术语和真的不知道什么是提供或如何操纵它。我发现波形的例子在JavaScript中,但他们太复杂/我不能COM prehend是怎么回事。那么我的问题是:你如何使用JavaScript来创建在画布上一首歌曲,和什么的波形是它背后的过程

I'm trying to use JavaScript to display the waveform for and audio file, but I don't even know how to get started. I found the Audio Data API, but am unfamiliar with most audio terms and don't really know what is provided or how to manipulate it. I found examples of waveforms in JavaScript, but they are too complicated/I can't comprehend what is going on. Then my question is: how can you use JavaScript to create a waveform of a song on canvas, and what exactly is the process behind it?

推荐答案

下面是从我的书的一些示例code( HTML5多媒体:开发和设计)这正是这么做的; 音频波形。它使用 Mozilla的音频数据API

Here's some sample code from my book (HTML5 Multimedia: Develop and Design) that does exactly that; Audio Waveform. It uses the Mozilla Audio Data API.

在code只是将音频数据的快照,并使用它来绘制在画布上。

The code simply takes snapshots of the audio data and uses it to draw on the canvas.

这篇关于在JavaScript中波形可视化从音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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