最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What are the specifications for HTML5 audio.volume - Stack Overflow

programmeradmin0浏览0评论

I've seem some code indicating that with javascript you can set the volume level of an HTML5 <audio> element using something like document.getElementById('player').volume-=0.1, but I can't find anything to indicate what the volume range is? 0-5? 0-10? 0-100? Does anyone know what the max volume of an audio tag is, and what the smallest increments it can be raised in are?

I've seem some code indicating that with javascript you can set the volume level of an HTML5 <audio> element using something like document.getElementById('player').volume-=0.1, but I can't find anything to indicate what the volume range is? 0-5? 0-10? 0-100? Does anyone know what the max volume of an audio tag is, and what the smallest increments it can be raised in are?

Share Improve this question edited Jul 21, 2012 at 17:27 Linuxios 35.8k13 gold badges95 silver badges118 bronze badges asked Mar 16, 2012 at 3:38 Chris SobolewskiChris Sobolewski 13k13 gold badges64 silver badges96 bronze badges 1
  • 4 I think the specifications may state that it goes from 0 to 10, but I'm pretty certain most implementations allow you to crank it up to 11 :-) – paxdiablo Commented Mar 16, 2012 at 3:41
Add a ment  | 

1 Answer 1

Reset to default 7

From the w3c HTML5 specification

... 4. Let volume be the playback volume of the audio portions of the media element, in range 0.0 (silent) to 1.0 (loudest).

发布评论

评论列表(0)

  1. 暂无评论