?? Ohun

Audio — Sound Playback & Recording

Methods

load / gbe

Ohun.load(path: String) ? AudioHandle

Load audio file.

ayanmo sound = Ohun.load("music.mp3");

play / ?ere

Ohun.play(handle: AudioHandle)

Play loaded audio.

ayanmo bgm = Ohun.load("background.mp3");
Ohun.play(bgm);

stop / duro

Ohun.stop(handle: AudioHandle)

Stop playing audio.

Ohun.stop(bgm);

volume / iro

Ohun.volume(handle: AudioHandle, level: Float)

Set volume (0.0 to 1.0).

Ohun.volume(bgm, 0.5);  // 50% volume

record / gbasil?

Ohun.record(path: String, duration_ms: Int)

Record audio to file.

Ohun.record("recording.wav", 5000);  // Record 5 seconds

Example: Sound Effects

// Load sound effects
ayanmo click = Ohun.load("click.wav");
ayanmo success = Ohun.load("success.wav");
ayanmo error = Ohun.load("error.wav");

// Play based on action
ese play_feedback(result) {
    ti (result) {
        Ohun.play(success);
    } bib?k? {
        Ohun.play(error);
    }
}

play_feedback(otito);