module Eagle::AudioPlayback

Overview

Playback settings shared by AudioPlayer and AudioPlayer2D.

Direct including types

Defined in:

eagle/nodes/audio_player.cr

Instance Method Summary

Instance Method Detail

def autoplay=(autoplay) #

Start playing when the node enters the tree.


def autoplay? #

Start playing when the node enters the tree.


def bus : String #

The mixer bus, such as "music" or "sfx". See Audio.bus.


def bus=(bus : String) #

The mixer bus, such as "music" or "sfx". See Audio.bus.


def effective_pan : Float32 #

The pan actually used.


def effective_volume : Float32 #

The volume actually used.


def emit_finished(*args) : Nil #

Emitted when a non-looping sound reaches its end. Connect with on_finished { ... }.


def finished : Eagle::Emitter() #

Emitted when a non-looping sound reaches its end. Connect with on_finished { ... }.


def loop=(loop) #

Restart from the beginning when the sound ends.


def loop? #

Restart from the beginning when the sound ends.


def on_finished(&block : -> Nil) : Proc(Nil) #

Emitted when a non-looping sound reaches its end. Connect with on_finished { ... }.


def pan : Float32 #

Stereo position from -1 to 1. AudioPlayer2D computes it from position instead.


def pan=(pan : Float32) #

Stereo position from -1 to 1. AudioPlayer2D computes it from position instead.


def pan=(v : Number) #

Sets #pan from any number.


def pitch : Float32 #

Playback speed: 1 is normal.


def pitch=(pitch : Float32) #

Playback speed: 1 is normal.


def pitch=(v : Number) #

Sets #pitch from any number.


def play(sound : Sound | Nil = nil) : Voice | Nil #

Plays sound, or the current #sound. Stops what was playing first. Returns the voice.


def playing? : Bool #

True while the sound is playing.


def sound : Sound | Nil #

The sound to play.


def sound=(sound : Sound | Nil) #

The sound to play.


def stop : Nil #

Stops playback.


def update_voice : Nil #

Pushes volume, pitch and pan to the playing voice. Called every frame.


def voice : Voice | Nil #

The voice currently playing, if any.


def volume : Float32 #

Volume from 0 to 1.


def volume=(volume : Float32) #

Volume from 0 to 1.


def volume=(v : Number) #

Sets #volume from any number.