0

I am using howler js in a new project, and cannot get left/right pan to work. The document says to use the pos() function, and set the x value to -1000 - +1000. My code:

howl.pos(-1000,0,0) for pan left
howl.post(1000,0,0) for pan right

But I do not hear a difference at all. I have tested in Chrome, Safari, and Firefox.

Howler JS 2.0 Documentation

Raff
  • 828
  • 10
  • 16
  • Those are the upper limits, which means that going all the way to -1000 and 1000 will make your audio so incredibly distant that it probably won't be audible. Try setting closer to a range of -1 to -10 and 1 to 10 and you'll probably have better results. – James Simpson Jan 26 '16 at 00:15
  • Thanks James. I think that's what I am after. I wanted to be able to make the right channel 100% and the left channel 0% (pan right), for example. How do I accomplish that? – Raff Jan 26 '16 at 14:43

2 Answers2

1

Try using this:

howl.stereo(-1) for pan left 100%
howl.stereo(1) for pan right 100%
0

It looks like Howler is abstracting the Web Audio API PannerNode which requires you to do the needed math to create an equal power panning effect. The Web audio API when used directly now has a StereoPannerNode that does exactly what you want. It looks like Howler needs to update their library.

Community
  • 1
  • 1
William
  • 4,422
  • 17
  • 55
  • 108