Class: Audio::FMODDriver

Inherits:
DriverBase show all
Defined in:
docs/0_Dependencies.rb

Constant Summary collapse

AUDIO_FILENAME_EXTENSIONS =

List of the Audio extension that are supported

['.ogg', '.mp3', '.wav', '.mid', '.aac', '.wma', '.it', '.xm', '.mod', '.s3m', '.midi', '.flac']
AUDIO_PRIORITIES =

List of Audio Priorities (if not found => 128)

{bgm: 0, me: 1, bgs: 2, se: 250, cries: 249}
FADE_IN_TIME =

Time of the audio fade in

250
@@BUG_FMOD_INITIALIZED =
false

Instance Method Summary collapse

Constructor Details

#initializeFMODDriver

Create a new FMOD driver



2865
2866
# File 'docs/0_Dependencies.rb', line 2865

def initialize
end

Instance Method Details

#fade_channel_out(channel, duration)

Fade a channel out

Parameters:

  • channel (Symbol)

    channel to fade

  • duration (Integer)

    duration of the fade out in ms



2894
2895
# File 'docs/0_Dependencies.rb', line 2894

def fade_channel_out(channel, duration)
end

#get_channel_audio_position(channel) ⇒ Integer

Get a channel audio position

Parameters:

  • channel (Symbol)

Returns:

  • (Integer)

    channel audio position in driver’s unit



2908
2909
# File 'docs/0_Dependencies.rb', line 2908

def get_channel_audio_position(channel)
end

#get_channel_duration(channel) ⇒ Integer

Get a channel duration

Parameters:

  • channel (Symbol)

Returns:

  • (Integer)


2927
2928
# File 'docs/0_Dependencies.rb', line 2927

def get_channel_duration(channel)
end

#mute_channel_for(channel, duration)

Mute a channel for an amount of time

Parameters:

  • channel (Symbol)
  • duration (Integer)

    mute duration in driver’s time



2918
2919
# File 'docs/0_Dependencies.rb', line 2918

def mute_channel_for(channel, duration)
end

#play_music(channel, filename, volume, pitch, fade_with_previous)

Play a music (looped)

Parameters:

  • channel (Symbol)

    channel for the music (:bgm, :bgs)

  • filename (String)

    name of the sound

  • volume (Integer)

    volume of the sound (0~100)

  • pitch (Integer)

    pitch of the sound (50~150)

  • fade_with_previous (Boolean)

    if the previous music should be faded with this one



2889
2890
# File 'docs/0_Dependencies.rb', line 2889

def play_music(channel, filename, volume, pitch, fade_with_previous)
end

#play_sound(channel, filename, volume, pitch)

Play a sound (just once)

Parameters:

  • channel (Symbol)

    channel for the sound (:se, :me)

  • filename (String)

    name of the sound

  • volume (Integer)

    volume of the sound (0~100)

  • pitch (Integer)

    pitch of the sound (50~150)



2881
2882
# File 'docs/0_Dependencies.rb', line 2881

def play_sound(channel, filename, volume, pitch)
end

#release

Release the driver



2874
2875
# File 'docs/0_Dependencies.rb', line 2874

def release
end

#reset

Reset the driver



2871
2872
# File 'docs/0_Dependencies.rb', line 2871

def reset
end

#set_channel_audio_position(channel, position)

Set a channel audio position

Parameters:

  • channel (Symbol)
  • position (Integer)

    audio position in driver’s unit



2913
2914
# File 'docs/0_Dependencies.rb', line 2913

def set_channel_audio_position(channel, position)
end

#set_channel_volume(channel, volume)

Set a channel volume

Parameters:

  • channel (Symbol)

    channel to set the volume

  • volume (Integer)

    volume of the channel (0~100)



2903
2904
# File 'docs/0_Dependencies.rb', line 2903

def set_channel_volume(channel, volume)
end

#stop_channel(channel)

Stop a channel

Parameters:

  • channel (Symbol)

    channel to stop



2898
2899
# File 'docs/0_Dependencies.rb', line 2898

def stop_channel(channel)
end

#unmute_channel(channel)

Unmute a channel

Parameters:

  • channel (Symbol)


2922
2923
# File 'docs/0_Dependencies.rb', line 2922

def unmute_channel(channel)
end

#update

Update the driver (must be called every meaningful frames)



2868
2869
# File 'docs/0_Dependencies.rb', line 2868

def update
end