[SIZE=+2]FmodEx::Sound methods[/SIZE]
Here are the methods of the FmodEx::Sound class.
At the exception of initialize, the following methods can return nil.
Think check if the result is not nil before using them in calculations.
You can create a sound independently of the BGM, BGS, ME and SE by using the "new" method of FmodEx::Sound (with the arguments of the initialize method).
initialize(filename, volume = 100, pitch = 100, position = 0, looping = true, streaming = true, *args)
Initialize a sound.
Arguments : filename, volume, pitch, position, looping, streaming, memory_data, dls_file_name
Optional from volume (include)
If the position is less than 0, sound will initially paused.
memory_data corresponds at a string/channel who contains the file data.
dls_file_name is the name of the dls file used to read the midis.
stop
Stop the sound (automatically release the channel and the sound)
Return true if the stop was made, false if stop isn't possible.
Raise a FmodEx::Error exception if FmodEx fails and no Fade Thread is associated with sound.
fade(time_ms)
Fade out of a sound.
The user indicate the time in milliseconds.
Return true if the sound fade was triggered, false if not.
pause(pause_state)
Pausing a sound.
The user indicates if he wants the sound to be paused (true) or played (false).
Returns requested pause status, or nil if it is not possible.
Raises a FmodEx :: Error exception if FmodEx can not paused the sound.
paused?
Retrieve the "pause" status of a sound.
Return true if the sound is in pause, false if not.
Raise a FmodEx::Error exception if FmodEx cannot retrieve the status.
set_loop_points(begin_pt, end_pt)
Indicate the loop points of the sound.
If the sound is looped, the user can indicate the begin and end of the loop in milliseconds.
Returns true if this was done, nil if this is not possible.
Raise a FmodEx::Error exception if FmodEx cannot save the loop points.
set_looping(state)
Indicate the loop possibility.
The user indicates if he wants the sound is looped (true) or not (false)
Returns the requested status, nil if is not possible.
Raise a FmodEx::Error exception if FmodEx cannot modify the sound status.
looping?
Return if the sound is looped or not.
Raise a FmodEx::Error exception if FmodEx cannot retrieve the status.
set_position(position_ms)
Indicates the playing position of a sound.
The user indicate the playing position in milliseconds.
Return the requested position if it cannot save.
Raise a FmodEx::Error exception if FmodEx cannot modify the position.
get_position
Return the actual position of the sound playing.
Raise a FmodEx::Error exception if FmodEx fails.
set_volume(volume)
Indication of sound volume.
The user indicates the desired volume between 0 and 100.
Returns the requested volume if realized.
Raise a FmodEx::Error exception if FmodEx fails.
get_volume
Returns the sound volume.
Raise a FmodEx::Error exception if FmodEx cannot retrieve the volume.
set_frequency(frequency)
Indicate the sound frequency.
Return the indicated frequency if it was realized.
Raise a FmodEx::Error exception if FmodEx cannot change the sound frequency.
get_frequency
Retrieve the sound frequency .
Raise a FmodEx::Error exception if FmodEx cannot retrieve the sound playing frequency.
set_pan(pan)
Indicates the sound pan (-100 = Left, 0 = Center, 100 = right)
Return the requested value.
Raise a FmodEx::Error exception if FmodEx cannot modify the pan.
get_pan
Retrieve sound pan.
Raise a FmodEx::Error exception if FmodEx cannot retrieve the pan.
playing?
Is FmodEx currently playing the sound ?
Return true if is the case.
Raise a FmodEx::Error exception if FmodEx cannot know what it does of the sound.
length
Retrieve the sound temporal length in milliseconds.
Raise a FmodEx::Error exception if FmodEx cannot retrieve the sound length.
[a id]fmodex[/a id][SIZE=+2]FmodEx module methods
[/SIZE]
FmodEx.init(nb_of_channels)
FmodEx initialisation.
nb_of_channels indicate the desired number of channels.
Return true if is succeed, false if already initialized.
Raise a FmodEx::Error exception if FmodEx fails in its task.
FmodEx.bgm_play(filename, volume = 100, pitch = 100, streaming = true, *args)
Play a ME.
Returns the ME sound playing.
Arguments : filename [,volume [, pitch [, streaming [, memory [, dls]]]]]
memory is the string that contain the file in RAM.
dls_file_name is the name of the dls file used to read the midis.
FmodEx.bgm_stop
Stop a BGM.
FmodEx.bgm_fade(time_ms)
Fade the BGM out.
time_ms is the fade out time in milliseconds.
FmodEx.bgm_sound
Retrieve the object FmodEx::Sound of BGM.
Can be nil if no BGM is played.
FmodEx.bgs_play(filename, volume = 100, pitch = 100, streaming = true, *args)
Play a BGS.
Returns the BGS sound playing.
Arguments : filename [,volume [, pitch [, streaming [, memory [, dls]]]]]
memory is the string that contain the file in RAM.
dls_file_name is the name of the dls file used to read the midis.
FmodEx.bgs_stop
Stop a BGS.
FmodEx.bgs_fade(time_ms)
Fade the BGS out.
time_ms is the fade out time in milliseconds.
FmodEx.bgs_sound(filename, volume = 100, pitch = 100, streaming = true, *args)
Retrieve the object FmodEx::Sound of BGS.
Can be nil if no BGS is played.
FmodEx.me_play
Play a ME.
Returns the ME sound.
Arguments : filename [,volume [, pitch [, streaming [, memory [, dls]]]]]
memory is the string that contain the file in RAM.
dls_file_name is the name of the dls file used to read the midis.
FmodEx.me_stop
Stop a ME.
FmodEx.fade_out(time_ms)
Fade the ME out.
time_ms is the fade out time in milliseconds.
FmodEx.me_sound
Retrieve the object FmodEx::Sound of ME.
Can be nil if no ME is played.
FmodEx.se_play(filename, volume = 100, pitch = 100, streaming = true, *args)
Play a SE.
Returns the SE sound.
Arguments : filename [,volume [, pitch [, streaming [, memory [, dls]]]]]
memory is the string that contain the file in RAM.
dls_file_name is the name of the dls file used to read the midis.
FmodEx.se_stop
Stops the SE.
[a id]credits[/a id]