pods::...::Sound(3pm)
okay bestie, welcome to the pods::...::Sound(3pm) page β it's from the User Contributed Perl Documentation, and it's all about making SDLx::Sound do its little audio thing. π§π
β¨ NAME β¨
SDLx::Sound
π CATEGORY π
Extension
π¦ SYNOPSIS π¦
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();
π DESCRIPTION π
okay so you can think about SDLx::Sound with 2 approaches, bestie:
- A simple sound or
- The sound of your game or app.
Your application will say what the best approach is. β¨
In a taste that resembles both Perl and SDL, our SDLx:Sound hooks at SDL::Audio and SDL::Mixer with a graceful and simple interface that can offer monks a modern perlish way to manage sounds. π§
An SDLx::Sound object can load sounds from the filesystem, play it, adjust this loudness level or stops the sound. πΆ
Each sound will play in the next available channel, so it can be handled isolately (their word! π
).
πΈ METHODS πΈ
π«Ά new
Returns a new instance of SDLx::Sound.
π load
Listed in the method lineup; the page doesn't add extra description here.
π§ play
$sdlx_sound->play('file.wav');
Play a file.
βΈοΈ pause
Listed in the method lineup; the page doesn't add extra description here.
βΆοΈ resume
Listed in the method lineup; the page doesn't add extra description here.
βΉοΈ stop
Listed in the method lineup; the page doesn't add extra description here.
π AUTHORS π
See "AUTHORS" in SDL.
π COPYRIGHT & LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
later, bestie β this page was served by perl v5.42.0, dated 2024-05-01. π«Άβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms