在客户端JavaScript中将WAV转换为任何压缩音频格式 [英] Converting WAV to any compressed audio format in client-side JavaScript
问题描述
我正在使用 getUserMedia({audio:true}); 的音频> Recorder.js ,然后将其导出为WAV文件,因为这是图书馆提供的唯一选项。
I am recording audio from getUserMedia({audio:true});
in the browser using Recorder.js and then exporting it as a WAV file because that's the only option the library provides.
1分20秒文件是14.1 MB大。我需要将音频上传到服务器,我需要快速完成。如何转换任何其他压缩格式的WAV音频以降低文件大小?
A 1 minute 20 seconds file is 14.1 MB large. I need to upload the audio to a server and I need to do it fast. How do I convert the WAV audio in any other compressed format to lower the file size?
我不介意转换为:
- MP3
- Opus
- WebM
- Ogg
- FLAC
- 您知道的任何其他格式
- MP3
- Opus
- WebM
- Ogg
- FLAC
- any other format you know of
如果现在没办法转换为这些格式中的任何一种,我怎样才能在客户端上压缩WAV文件?
If there is no way as of now to convert to any of these formats, how can I compress the WAV file on the client?
PS:我做了很多搜索找到任何在JS中转换WAV的东西,但什么也没找到。 libmp3lame.js 无法在Chrome中使用。
PS: I did a lot of searches to find anything that converts WAV in JS, but found nothing. libmp3lame.js isn't working in Chrome.
谢谢!
推荐答案
我制作了一个录音机,直接从浏览器中记录到mp3,结合了RecorderJS和libmp3lame.js
I've made an audio recorder that records to mp3 directly from the browser combining RecorderJS and libmp3lame.js
您可以在此处找到gitHub项目:
https:/ /github.com/nusofthq/Recordmp3js
You can find the gitHub project here: https://github.com/nusofthq/Recordmp3js
以及有关实施的更详细说明:
http://nusofthq.com/blog/recording-mp3-using-only-html5-和-javascript-recordmp3-js /
and a more detailed explanation of the implementation: http://nusofthq.com/blog/recording-mp3-using-only-html5-and-javascript-recordmp3-js/
这篇关于在客户端JavaScript中将WAV转换为任何压缩音频格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!