panning

NobodyX

  • *
  • Posts: 1228
What code would I use to pan the sound of the entire game, in other words to silence either the left or right speaker?



Miasmos Games

  • Posts: 878
The only way I've found to do this is something like in here: http://api.stencyl.com/as3/stencyl/api/engine/sound/SoundClip.html Hope that helps :)

Cupcake Bounce

Hectate

  • *
  • Posts: 4643
Haven't read the above link, but it occurs to me that if you have two identical sounds playing on two separate channels you can adjust each one separately, right? So if one sound is created so that it's all panned to one side, and the other is created opposite, you can control it in stereo.

I have no idea how to do that for everything in a game though.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

NobodyX

  • *
  • Posts: 1228
The above link seems to be only about individual sounds, what I'd like is panning the entire game's sound or maybe a channel's sound.

Alright, thanks. I guess if it's not going to be easy to figure out, then it's not important enough to do so. I was going to use it as a short-lived gimmick in my game. If anyone does have an easy answer then I'd really like to hear it though.

coleislazy

  • *
  • Posts: 2607
In the API, I see that the SoundClip class has a property called "panning". If it is like the AS3 syntax, it uses values from -1 to 1 (full left to full right). I don't have access to SW right now, so I can't test it out.

EDIT: D'oh, just read that you wanted all sounds. Sorry. You'd probably have to keep track of all playing sounds in an array and iterate through them, panning each individually.