Method: FMOD::ChannelControl#pan
- Defined in:
- lib/fmod/channel_control.rb
#pan(pan) ⇒ self
Sets the pan level, this is a helper to avoid setting the #matrix.
Mono sounds are panned from left to right using constant power panning (non-linear fade). This means when pan = 0.0, the balance for the sound in each speaker is 71% left and 71% right, not 50% left and 50% right. This gives (audibly) smoother pans.
Stereo sounds heave each left/right value faded up and down according to the specified pan position. This means when pan is 0.0, the balance for the sound in each speaker is 100% left and 100% right. When pan is -1.0, only the left channel of the stereo sound is audible, when pan is 1.0, only the right channel of the stereo sound is audible.
748 749 750 751 |
# File 'lib/fmod/channel_control.rb', line 748 def pan(pan) FMOD.invoke(:ChannelGroup_SetPan, self, pan.clamp(-1.0, 1.0)) self end |