Firefox将无法播放.wav使用HTML5&LT文件;音频&GT;标签? [英] Firefox won't play .WAV files using the HTML5 <audio> tag?
问题描述
我建立一个网页,将允许用户上传MP3文件。该MP3文件转换在后端使用一个.wav文件LAME。
I'm building a page that will allow a user to upload an MP3 file. That MP3 file is converted in the back end to a .WAV file using LAME.
该蹩脚执行脚本是在这里:
The lame execution script is here:
LAME --resample 44.1 -decode myDirectoryPath/Master.mp3 myDirectoryPath/Master.wav
然而,当我使用HTML5音频标签在Firefox音频文件中创建一个球员,这是行不通的。
However, when I use the HTML5 audio tag to create a player for that audio file in Firefox, it doesn't work.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<audio controls>
<source src="myDirectoryPath/Master.mp3">
<source src="myDirectoryPath/Master.wav">
</audio>
</body>
</html>
我读过的一切表示,火狐的.wav文件,支持...我无法找到一个简单的.mp3来.OGG使用,将转换为master.mp3格式.OGG命令行工具。有人可以提供什么就尝试下一些建议吗?
Everything I've read says that Firefox supports .wav files... and I can't find a simple .mp3 to .ogg command line tool to use that will convert the master.mp3 to .ogg format. Can someone offer some suggestions on what to try next?
我已经张贴code,在Safari和Chrome在这里工作:
http://www.wgbh.org/byers/Audio/index.html
I've posted code that works in Safari and Chrome here: http://www.wgbh.org/byers/Audio/index.html
无论出于何种原因,FF不喜欢它。
For whatever reason, FF doesn't like it.
更新
(附有捂脸)问题在于我的LAME德code。正确的语法是--de code以两个破折号,而不是一个。该系统实际上是从MP3到MP3编码它,将其命名为WAV和Safari /铬在Mac上是假设的文件类型。
UPDATE (With accompanying facepalm) The issue lies with my LAME decode. The correct syntax is --decode with two dashes instead of one. The system was actually encoding it from mp3 to mp3, naming it wav and Safari / Chrome on the Mac was assuming the file type.
推荐答案
什么是你的WAV文件的位深? Firefox支持8位和16位PCM,但是没有其他的位深度(12,20,24,32)。
What's the bit depth on your WAV files? Firefox supports 8-bit and 16-bit PCM, but not other bit depths (12, 20, 24, 32).
这篇关于Firefox将无法播放.wav使用HTML5&LT文件;音频&GT;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!