Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sdl::audiospec(3pm) [debian man page]

pods::SDL::AudioSpec(3pm)				User Contributed Perl Documentation				 pods::SDL::AudioSpec(3pm)

NAME
SDL::AudioSpec -- SDL Bindings for structure SDL::AudioSpec CATEGORY
Core, Audio, Structure SYNOPSIS
use SDL; use SDL::AudioSpec; SDL::init(SDL_INIT_AUDIO); my $audio_spec = SDL::AudioSpec->new(); $audio_spec->freq(22050); # 22050Hz - FM Radio quality $audio_spec->format(AUDIO_S16SYS); # 16-bit signed audio $audio_spec->samples(8192); # Large audio buffer reduces risk of dropouts but increases response time $audio_spec->channels(1); # Mono $audio_spec->callback('main::callback'); sub callback { # do something here } DESCRIPTION
The "SDL::AudioSpec" structure is used to describe the format of some audio data. This structure is used by "SDL::Audio::open_audio" and "SDL::Audio::load_wav". While all fields are used by "SDL::Audio::open_audio", only "freq", "format", "samples" and "channels" are used by "SDL::Audio::load_wav". We will detail these common members here. METHODS
freq The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better. format Specifies the size and type of each sample element. Values it can take are: AUDIO_U8 Unsigned 8-bit samples. AUDIO_S8 Signed 8-bit samples. AUDIO_U16 or AUDIO_U16LSB not supported by all hardware (unsigned 16-bit little-endian) AUDIO_S16 or AUDIO_S16LSB not supported by all hardware (signed 16-bit little-endian) AUDIO_U16MSB not supported by all hardware (unsigned 16-bit big-endian) AUDIO_S16MSB not supported by all hardware (signed 16-bit big-endian) AUDIO_U16SYS Either AUDIO_U16LSB or AUDIO_U16MSB depending on hardware CPU endianness AUDIO_S16SYS Either AUDIO_S16LSB or AUDIO_S16MSB depending on hardware CPU endianness channels The number of separate sound channels. 1 is mono (single channel), 2 is stereo (dual channel). samples When used with "SDL::Audio::open_audio" this refers to the size of the audio buffer in samples. A sample is a chunk of audio data of the size specified in format multiplied by the number of channels. When the "SDL::AudioSpec" is used with "SDL::Audio::load_wav" samples is set to 4096. callback To be documented. AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDL::AudioSpec(3pm)

Check Out this Related Man Page

pods::SDL::Mixer::Groups(3pm)				User Contributed Perl Documentation			     pods::SDL::Mixer::Groups(3pm)

NAME
SDL::Mixer::Groups - Audio channel group functions CATEGORY
Mixer METHODS
reserve_channels my $reserved = SDL::Mixer::Groups::reserve_channels( $num ); $num is the number of channels to reserve from default mixing. Zero removes all reservations. Reserve $num channels from being used when playing samples when passing in "-1" as a channel number to playback functions. The channels are reserved starting from channel 0 to "$num-1". Passing in zero will unreserve all channels. Normally SDL_mixer starts without any channels reserved. The following functions are affected by this setting: o SDL::Mixer::Channels::play_channel o SDL::Mixer::Channels::play_channel_timed o SDL::Mixer::Channels::fade_in_channel o SDL::Mixer::Channels::fade_in_channel_timed Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels previously allocated (see SDL::Mixer::Channels::allocate_channels). group_channel my $grouped = SDL::Mixer::Groups::group_channel( $channel, $group ); Add a channel to group id (any positive integer), or reset it's group to the default group by passing (-1). Returns: True(1) on success. False(0) is returned when the channel specified is invalid. group_channels my $grouped = SDL::Mixer::Groups::group_channels( $from_channel, $to_channel, $group ); Add a range of channels to group id (any positive integer), or reset their group to the default group by passing (-1). Returns: The number of affected channels. group_available my $channel = SDL::Mixer::Groups::group_count( $group ); "group_newer" returns the first available channel of this group. group_count my $channels = SDL::Mixer::Groups::group_count( $group ); "group_newer" returns the number of channels in this group. group_oldest my $channel = SDL::Mixer::Groups::group_oldest( $group ); "group_newer" returns the channel number which started to play at first. group_newer my $channel = SDL::Mixer::Groups::group_newer( $group ); "group_newer" returns the channel number which started to play at last. fade_out_group SDL::Mixer::Groups::fade_out_group( $group, $ms ); Fades out the channels by the given group id. The fade-out-time is specified by $ms. Returns the number of affected channels. halt_group SDL::Mixer::Groups::hals_group( $group ); Halts the channels by the given group id. Returns 0. AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDL::Mixer::Groups(3pm)
Man Page