View Source Rayex.Audio (Rayex v0.0.3)

Audio related functions

Summary

Functions

Initialize audio device and context

Check if audio device has been initialized successfully

Checks if a sound is ready

Load sound from file

Play a sound

Set master volume (listener)

Stop a sound

Functions

@spec init_audio_device() :: :ok

Initialize audio device and context

Link to this function

is_audio_device_ready?()

View Source
@spec is_audio_device_ready?() :: boolean()

Check if audio device has been initialized successfully

@spec is_sound_ready?(Rayex.Structs.Sound.t()) :: boolean()

Checks if a sound is ready

@spec load_sound(String.t()) :: Rayex.Structs.Sound.t()

Load sound from file

@spec play_sound(Rayex.Structs.Sound.t()) :: :ok

Play a sound

Link to this function

set_master_volume(volume)

View Source
@spec set_master_volume(float()) :: :ok

Set master volume (listener)

@spec stop_sound(Rayex.Structs.Sound.t()) :: :ok

Stop a sound