pods::...::Sound(3pm)

πŸ’– NAME πŸ’–

SDLx::Sound β€” the SDL sound extension, bestie. It's a Perl thing (that's the 3pm up in the header, and it lives in the User Contributed Perl Documentation corner of the world).

πŸŽ€ CATEGORY πŸŽ€

Extension ✨

🌈 SYNOPSIS 🌈

Okay so here's the whole vibe, copy-paste ready:

use SDLx::Sound;

my $snd = SDLx::Sound->new();

# loads and plays a single sound now
$snd->play('myfile.wav');

# load a single file
$snd->load('theSound.aif');

# plays it or all loaded files
$snd->play();

# more sounds
my %files = (
    channel_01 => "/my_sound1.wav",
    channel_02 => "/my_sound2.ogg"
);

# times sounds bangs
my %times = (
    channel_01 => 0,      # start
    channel_01 => 1256,   # milliseconds
    channel_02 => 2345
);

# Load files in channels for realtime play
$snd->load(%files);

# sets sound channel_01 loudness
$snd->loud('channel_01', 80);       # loud at 80%
$snd->play(%times);                 # play loaded files at times
$snd->play;                         # play again

# plays sound channel_01 at 578 milliseconds from now
$snd->play('channel_01', 578);

# fades sound
$snd->fade('channel_02', 2345, 3456, -20);

# in a single act do the whole Sound
my $snd = SDLx::Sound->new(
    files => (
        channel_01 => "/my_sound1.wav",
        channel_02 => "/my_sound2.ogg"

    ),
    loud  => (
        channel_01 => 80,
        channel_02 => 75
    ),
    times => (
        channel_01 => 0,      # start
        channel_01 => 1256,   # milliseconds
        channel_02 => 2345
    ),
    fade  => (
        channel_02 => [2345, 3456, -20]
    )
)->play();

(and yes, channel_01 really does show up twice inside %times β€” that's literally what's written here, so I'm not touching it πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole way to think about SDLx::Sound? There are literally two approaches, bestie:

  • A simple sound, or
  • The sound of your game or app.

Whichever one slaps harder is up to your application β€” it's the one that knows what it needs. πŸ‘‘

In a taste that's giving perl and giving SDL at the same time, our SDLx::Sound hooks at SDL::Audio and SDL::Mixer with a graceful and simple interface β€” so monks out there get a modern, perlish way to manage sounds. It's giving ✨ icon energy ✨ ngl.

An SDLx::Sound object can load sounds from the filesystem, play them, adjust their loudness level, or stop the sound. All of it.

And each sound plays in the next available channel, so it can be handled on its own β€” isolated, separate, living its own little life. 🎧

🧚 METHODS 🧚

new

Returns a new instance of SDLx::Sound. Fresh out the box, main character energy. 🫢

load

Loads stuff. That's the move. (It's listed right here in the methods, no extra prose attached, so I'm not making anything up about it β€” nope, not today πŸ™ˆ)

play

$sdlx_sound->play('file.wav');

Plays a file. That's it, that's the whole job. πŸ”Š

pause

Pauses. ⏸️

resume

Resumes. ▢️

stop

Stops. ⏹️

No cap, that's genuinely all the original says for load, pause, resume and stop β€” just the names, no extra details. Not gonna invent lore. πŸ’€

🌸 AUTHORS 🌸

See "AUTHORS" in SDL. 🫑

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Periodt. πŸ’œ


and that's the tea, bestie πŸ“ β€” this page came from perl v5.42.3, dated 2026-08-19, and it's the pods::...::Sound(3pm) page, so you know exactly where it came from. iykyk πŸ’…βœ¨

πŸ“¦ where this page comes from