Module: Audio
- Defined in:
- docs/0_Dependencies.rb
Overview
Module responsive of handling audio in game
Defined Under Namespace
Classes: DriverBase, FMODDriver, SFMLAudioDriver
Constant Summary collapse
- FADE_IN_BY_DEFAULT =
Constant allowing maker to define if music must fade in by default
true- ALL_CHANNELS_SYM =
All possible channels used in-game
%i[bgm cries se me bgs]
Class Method Summary collapse
-
.__init__
Globally initialize the audio module (after all driver has been chosen and the game was loaded).
-
.__release__
Globally release the audio module (after the game is done or if you need to swap drivers).
-
.__reset__
Globally reset the audio (when soft resetting the game or for other reasons).
-
.bgm_fade(time)
Fades the BGM.
-
.bgm_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil)
plays a BGM and stop the current one.
-
.bgm_position ⇒ Integer
Returns the BGM position.
-
.bgm_position=(position)
Set the BGM position.
-
.bgm_stop
Stop the BGM.
-
.bgs_fade(time)
Fades the BGS.
-
.bgs_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil)
plays a BGS and stop the current one.
-
.bgs_position ⇒ Integer
Returns the BGS position.
-
.bgs_position=(position)
Set the BGS position.
-
.bgs_stop
Stop the BGS.
-
.cry_play(filename, volume = 100, pitch = 100)
plays a cry.
-
.driver ⇒ DriverBase
Get the current driver.
-
.me_fade(time)
Fades the ME.
-
.me_play(filename, volume = 100, pitch = 100, preserve_bgm = false)
plays a ME and stop the current one.
-
.me_position ⇒ Integer
Returns the ME position.
-
.me_position=(position)
Set the ME position.
-
.me_stop
Stop the ME.
-
.music_channels ⇒ Array<Symbol>
Get all the music channels (to patch if you want to include more).
-
.music_volume ⇒ Integer
Get volume of bgm and me.
-
.music_volume=(value)
Set the volume of bgm and me.
-
.mute_channels
Mute all channels for infinite time.
-
.register_driver(driver_name, driver_class)
Register an audio driver.
-
.se_play(filename, volume = 100, pitch = 100)
plays a SE if possible.
-
.se_stop
Stop SE.
-
.sfx_channels ⇒ Array<Symbol>
Get all the sfx channels (to patch if you want to include more).
-
.sfx_volume ⇒ Integer
Get volume of sfx.
-
.sfx_volume=(value)
Set the volume of sfx.
-
.unmute_channels
Unmute all channels This will unmute all channels, even if they were muted for a specific duration.
-
.update
Update the audio (must be called every meaningful frames).
Class Method Details
.__init__
Globally initialize the audio module (after all driver has been chosen and the game was loaded)
2911 2912 |
# File 'docs/0_Dependencies.rb', line 2911 def __init__ end |
.__release__
Globally release the audio module (after the game is done or if you need to swap drivers)
2914 2915 |
# File 'docs/0_Dependencies.rb', line 2914 def __release__ end |
.__reset__
Globally reset the audio (when soft resetting the game or for other reasons)
2917 2918 |
# File 'docs/0_Dependencies.rb', line 2917 def __reset__ end |
.bgm_fade(time)
Fades the BGM
2983 2984 |
# File 'docs/0_Dependencies.rb', line 2983 def bgm_fade(time) end |
.bgm_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil)
plays a BGM and stop the current one
2971 2972 |
# File 'docs/0_Dependencies.rb', line 2971 def bgm_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil) end |
.bgm_position ⇒ Integer
Returns the BGM position
2975 2976 |
# File 'docs/0_Dependencies.rb', line 2975 def bgm_position end |
.bgm_position=(position)
Set the BGM position
2979 2980 |
# File 'docs/0_Dependencies.rb', line 2979 def bgm_position=(position) end |
.bgm_stop
Stop the BGM
2986 2987 |
# File 'docs/0_Dependencies.rb', line 2986 def bgm_stop end |
.bgs_fade(time)
Fades the BGS
3006 3007 |
# File 'docs/0_Dependencies.rb', line 3006 def bgs_fade(time) end |
.bgs_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil)
plays a BGS and stop the current one
2994 2995 |
# File 'docs/0_Dependencies.rb', line 2994 def bgs_play(filename, volume = 100, pitch = 100, fade_in = FADE_IN_BY_DEFAULT, position: nil) end |
.bgs_position ⇒ Integer
Returns the BGS position
2998 2999 |
# File 'docs/0_Dependencies.rb', line 2998 def bgs_position end |
.bgs_position=(position)
Set the BGS position
3002 3003 |
# File 'docs/0_Dependencies.rb', line 3002 def bgs_position=(position) end |
.bgs_stop
Stop the BGS
3009 3010 |
# File 'docs/0_Dependencies.rb', line 3009 def bgs_stop end |
.cry_play(filename, volume = 100, pitch = 100)
plays a cry
3046 3047 |
# File 'docs/0_Dependencies.rb', line 3046 def cry_play(filename, volume = 100, pitch = 100) end |
.driver ⇒ DriverBase
Get the current driver
2924 2925 |
# File 'docs/0_Dependencies.rb', line 2924 def driver end |
.me_fade(time)
Fades the ME
3028 3029 |
# File 'docs/0_Dependencies.rb', line 3028 def me_fade(time) end |
.me_play(filename, volume = 100, pitch = 100, preserve_bgm = false)
plays a ME and stop the current one
3016 3017 |
# File 'docs/0_Dependencies.rb', line 3016 def me_play(filename, volume = 100, pitch = 100, preserve_bgm = false) end |
.me_position ⇒ Integer
Returns the ME position
3020 3021 |
# File 'docs/0_Dependencies.rb', line 3020 def me_position end |
.me_position=(position)
Set the ME position
3024 3025 |
# File 'docs/0_Dependencies.rb', line 3024 def me_position=(position) end |
.me_stop
Stop the ME
3031 3032 |
# File 'docs/0_Dependencies.rb', line 3031 def me_stop end |
.music_channels ⇒ Array<Symbol>
Get all the music channels (to patch if you want to include more)
2945 2946 |
# File 'docs/0_Dependencies.rb', line 2945 def music_channels end |
.music_volume ⇒ Integer
Get volume of bgm and me
2937 2938 |
# File 'docs/0_Dependencies.rb', line 2937 def music_volume end |
.music_volume=(value)
Set the volume of bgm and me
2941 2942 |
# File 'docs/0_Dependencies.rb', line 2941 def music_volume=(value) end |
.mute_channels
Mute all channels for infinite time
3049 3050 |
# File 'docs/0_Dependencies.rb', line 3049 def mute_channels end |
.register_driver(driver_name, driver_class)
Register an audio driver
2929 2930 |
# File 'docs/0_Dependencies.rb', line 2929 def register_driver(driver_name, driver_class) end |
.se_play(filename, volume = 100, pitch = 100)
plays a SE if possible
3037 3038 |
# File 'docs/0_Dependencies.rb', line 3037 def se_play(filename, volume = 100, pitch = 100) end |
.se_stop
Stop SE
3040 3041 |
# File 'docs/0_Dependencies.rb', line 3040 def se_stop end |
.sfx_channels ⇒ Array<Symbol>
Get all the sfx channels (to patch if you want to include more)
2957 2958 |
# File 'docs/0_Dependencies.rb', line 2957 def sfx_channels end |
.sfx_volume ⇒ Integer
Get volume of sfx
2949 2950 |
# File 'docs/0_Dependencies.rb', line 2949 def sfx_volume end |
.sfx_volume=(value)
Set the volume of sfx
2953 2954 |
# File 'docs/0_Dependencies.rb', line 2953 def sfx_volume=(value) end |
.unmute_channels
Unmute all channels This will unmute all channels, even if they were muted for a specific duration
3053 3054 |
# File 'docs/0_Dependencies.rb', line 3053 def unmute_channels end |
.update
Update the audio (must be called every meaningful frames)
2920 2921 |
# File 'docs/0_Dependencies.rb', line 2920 def update end |