goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.98k stars 2.23k forks source link

How to increase volume past 1.0? #1082

Open dontfireme opened 5 years ago

dontfireme commented 5 years ago

Hello,

is it possible in any way to increase the volume past 100%? AFAIK .volume() method accepts argument from range (0, 1) - where 1 is 100%. I want to make sound a little bit louder. How can I achieve such functionality?

Thanks in advance!

themoonrat commented 5 years ago

https://www.youtube.com/watch?v=DzLP2Z7JVZA

Maqsyo commented 5 years ago

just set the rest of your audios to 90% ? or open the audio-file in audacity or a similiar program and increase the volume there

st-h commented 5 years ago

@dontfireme You can do that using web audio only (using a gain node). The (html5) audio element does not provide any means to increase volume past 1. As far as I know (please correct me if wrong) this project tries to provide an interface which is independent of which underlying technology is used. So, if it would be possible to set the volume greater than 1, this would work when web audio is used, but would break as soon as html5 is used.

tegola commented 3 years ago

I'm developing a simple two-track audio webapp with little experience with web audio, so I'm using Howler to fast-start the devlopment, but I need the volume to go past 100%. It looks like Howler isn't really designed to accept a gain value past 1. Is there an alternative, except lowering the volume for all other tracks (I need the dB measurement)?

edubeckha commented 2 years ago

I'm developing a simple two-track audio webapp with little experience with web audio, so I'm using Howler to fast-start the devlopment, but I need the volume to go past 100%. It looks like Howler isn't really designed to accept a gain value past 1. Is there an alternative, except lowering the volume for all other tracks (I need the dB measurement)?

Hi Tegola, got any solution for your problem? I'm having the same issue: I have two tracks that have to be played simultaneously, for several times, and I have to adjust the dB for one of the tracks every time the two tracks are played (it is a hearing test app). I'm using react-howler aswell, but it do not give me the option to adjust the volume by the dB neither give the option to set it above 100% (value 1). Thanks for the attention!

st-h commented 2 years ago

I think at the moment the best option is to not use howler and setup an audio graph that includes a gain node: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API

edubeckha commented 2 years ago

I think at the moment the best option is to not use howler and setup an audio graph that includes a gain node: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API

Thanks st-h, I'm gonna give it a try and see if it solves my problem.