Author Topic: Is it possible to mute just one speaker or the other in Flixel?  (Read 1964 times)

xyroclast

  • Contributor
  • ****
  • Posts: 389
  • Karma: +0/-0
    • View Profile
Or maybe shift the balance all the way to one side?

Thanks!

war_fire

  • Guest
Not in flixel. Probably not in the entirety of Flash either. Sorry, but i doubt you will ever have sucess in that, as different sound cards might/might not support it, and so if there was an option for it than Flash, the platform that is meant to be compatible with EVERYONE, will lose about a 6th of their users.

xyroclast

  • Contributor
  • ****
  • Posts: 389
  • Karma: +0/-0
    • View Profile
Hmm, just looking in the Flixel docs, it seems there are a few mentions of panning in FlxSound. Are they just hopeful / well-meaning but futile, or is there a lost secret to the art of panning?

xyroclast

  • Contributor
  • ****
  • Posts: 389
  • Karma: +0/-0
    • View Profile
Update: Panning certainly does work - It's in Flash's SoundTransform object. Setting pan to -1 is left speaker, 1 is right speaker, 0 is center

xyroclast

  • Contributor
  • ****
  • Posts: 389
  • Karma: +0/-0
    • View Profile
Now the question is, is there a pretty way to do it in Flixel? To pan the music, the quick and ugly hack I used was to make the _transform variable in FlxSound public and access its pan property (I could use an accessor method if I want to be fancy, I just want to know if Flixel has its own built in command

war_fire

  • Guest
I dont really think so, but have a look around. If FlxSound doesnt work, then dont use it. I odnt really see the difference between FlxSound and Sound. They both work.

IQAndreas

  • Member
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
    • IQAndreas.com
I thought there was a fancy way to do it in Flixel.

It involved creating a "dummy object" which you use with "sound.proximity()", making sure that object is entirely to one side or the other. Sadly, at the moment you move the "dummy" far enough away so it's only heard in one speaker, FlxSound also uses "distance fading" (quieter the further away from the target you are), and by then the sound is too far away to be heard at all.

There is no way to say "only pan the sound from left to right, don't reduce the volume if it is far away", but if think think that feature would be good to have, I can try to implement it.

But I'm glad you were able to get a workaround. :)

I don't really see the difference between FlxSound and Sound. They both work.
FlxSound is easier to use than Flash's Sound class. ;)

xyroclast

  • Contributor
  • ****
  • Posts: 389
  • Karma: +0/-0
    • View Profile
Ah, thank you for the followup! I'm not too desperate to solve any more mysteries regarding the panning right now, I only needed it for one very specific gimmick in my Ludum Dare game, so don't knock yourself out with any fancy solutions :)

Here's a shameless plug for my finished entry, if you want to see the panning in action :)

http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=22856