getaudiolevel
v1.0.0
Published
Get Audio Level of MediaStreamTrack
Downloads
4
Readme
audioLevelHelper.getAudioLevel
获取 MediaStreamTrack的音量值。对本地和远端音量均有效。
安装
npm install getaudiolevel
使用
import audioLevelHelper from 'getaudiolevel'
const level = audioLevelHelper.getAudioLevel(mediaStreamTrack)
注意,AudioContext在Safari等浏览器中可能会遭遇自动播放策略,需要手势触发
btn.onclick = ()=>{
audioLevelHelper.initAudioContext()
}