标签:
1. controls自带效果
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <audio src="raw/1.mp3" controls="controls"></audio> </body> </html>
2. 自定义
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <button id="button" onclick="p()">播放</button> <audio id="music" src="raw/1.mp3">浏览器不支持此音频</audio> <script> var music = document.getElementById("music"); var button = document.getElementById("button"); function p(){ if(music.paused){ music.play(); button.innerHTML = "暂停"; } else{ music.pause(); button.innerHTML = "播放"; } } </script> </body> </html>
3. 编解码工具
FFmpeg.org
<1>进去需要转码文件的文件夹
<2>ffmpeg路径 -i 需要转码文件名及后缀 -acodec libvorbis 想转成的文件及后缀
标签:
原文地址:http://www.cnblogs.com/iMirror/p/4290066.html