From: Tobias Leich Date: Mon, 23 Nov 2009 19:23:51 +0000 (+0100) Subject: docs for audiospec X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8758037aa08801115ece35cb26d33d5411833805;p=sdlgit%2FSDL-Site.git docs for audiospec --- diff --git a/pages/SDL-Audio.html-inc b/pages/SDL-Audio.html-inc index 32bb3fb..ff25844 100644 --- a/pages/SDL-Audio.html-inc +++ b/pages/SDL-Audio.html-inc @@ -3,7 +3,23 @@

Index


@@ -18,4 +34,76 @@

TODO, Core, Audio

+

DESCRIPTION

Top

+
+ + + + + +
+

METHODS

Top

+
+ +
+

open_audio

+
+

Opens the audio device with the desired parameters.

+ +
+

PauseAudio

+
+

Pauses and unpauses the audio callback processing

+ +
+

GetAudioStatus

+
+

Gets the current audio state

+ +
+

LoadWAV

+
+

Loads a WAVE file

+ +
+

FreeWAV

+
+

Frees previously opened WAV data

+ +
+

AudioCVT

+
+

Audio Conversion Structure

+ +
+

BuildAudioCVT

+
+

Initializes a SDL_AudioCVT - structure for conversion

+ +
+

ConvertAudio

+
+

Converts audio data to a desired audio format.

+ +
+

MixAudio

+
+

Mixes audio data

+ +
+

LockAudio

+
+

Locks out the callback function

+ +
+

UnlockAudio

+
+

Unlocks the callback function

+ +
+

CloseAudio

+
+

Shuts down audio processing and closes the audio device.

+ +
\ No newline at end of file diff --git a/pages/SDL-AudioSpec.html-inc b/pages/SDL-AudioSpec.html-inc index d8b7aea..61a5757 100644 --- a/pages/SDL-AudioSpec.html-inc +++ b/pages/SDL-AudioSpec.html-inc @@ -3,19 +3,113 @@

Index


NAME

Top

-

SDL::AudioSpec -- SDL Bindings for structure SDL_AudioSpec

+

SDL::AudioSpec -- SDL Bindings for structure SDL::AudioSpec

CATEGORY

Top

-

TODO, Core, Audio, Structure

+

Core, Audio, Structure

+ +
+

SYNOPSIS

Top

+
+
 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
+
+
+ +
+

DESCIPTION

Top

+
+

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

Top

+
+ +
+

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.

\ No newline at end of file diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 84bac75..61eb078 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
-

Documentation (latest development branch)

Core
thumbSDL Simple DirectMedia Layer for Perl
Events
thumbSDL::Events Bindings to the Events Category in SDL API
Structure
thumbSDL::Event General event structure
Joystick
thumbSDL::Joystick- SDL Bindings for the Joystick device
MultiThread
thumbSDL::MultiThread Bindings to the MultiThread category in SDL API
Video
thumbSDL::Video Bindings to the video category in SDL API
Structure
thumbSDL::Color Format independent color description
thumbSDL::Overlay YUV Video overlay
thumbSDL::PixelFormat Stores surface format information
thumbSDL::Rect Defines a rectangular area
thumbSDL::Surface
thumbSDL::VideoInfo Video Target Information

Cookbook
thumbSDL::Cookbook
thumbSDL::Cookbook::PDL

Extension
thumbSDL::App a SDL perl extension

Mixer
thumbSDL::Mixer a SDL perl extension
TODO
Core
Audio
thumbSDL::Audio- SDL Bindings for Audio
Structure
thumbSDL::AudioSpec- SDL Bindings for structure SDL_AudioSpec
Structure
thumbSDL::CD- SDL Bindings for structure SDL_CD
thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
Structure
thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
Mouse
thumbSDL::Mouse- SDL Bindings for the Mouse device
Structure
thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
thumbSDL::Version- SDL Bindings for structure SDL_Version

Tutorials
thumbSDL::Tutorial introduction to Perl SDL
thumbSDL::Tutorial::Animation
thumbSDL::Tutorial::Images
thumbSDL::Tutorial::LunarLander a small tutorial on Perl SDL
thumbSDL::Tutorial::Pong
thumbSDL::Tutorial::Tetris

UNCATEGORIZED
thumbSDL::Cdrom a SDL perl extension for managing CD-ROM drives
thumbSDL::Cursor a SDL perl extension
thumbSDL::Font a SDL perl extension
thumbSDL::Game::Palette a perl extension
thumbSDL::MPEG a SDL perl extension
thumbSDL::Music a perl extension
thumbSDL::OpenGL a perl extension
thumbSDL::Palette a perl extension
thumbSDL::SFont a perl extension
thumbSDL::SMPEG a SDL perl extension
thumbSDL::Sound a perl extension
thumbSDL::TTFont a SDL perl extension
thumbSDL::Timer a SDL perl extension for managing timers.
thumbSDL::Tool::Font a perl extension
thumbSDL::Tool::Graphic
+

Documentation (latest development branch)

Core
thumbSDL Simple DirectMedia Layer for Perl
Structure
thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
Events
thumbSDL::Events Bindings to the Events Category in SDL API
Structure
thumbSDL::Event General event structure
Joystick
thumbSDL::Joystick- SDL Bindings for the Joystick device
MultiThread
thumbSDL::MultiThread Bindings to the MultiThread category in SDL API
Video
thumbSDL::Video Bindings to the video category in SDL API
Structure
thumbSDL::Color Format independent color description
thumbSDL::Overlay YUV Video overlay
thumbSDL::PixelFormat Stores surface format information
thumbSDL::Rect Defines a rectangular area
thumbSDL::Surface
thumbSDL::VideoInfo Video Target Information

Cookbook
thumbSDL::Cookbook
thumbSDL::Cookbook::PDL

Extension
thumbSDL::App a SDL perl extension

Mixer
thumbSDL::Mixer a SDL perl extension
TODO
Core
Audio
thumbSDL::Audio- SDL Bindings for Audio
Structure
thumbSDL::CD- SDL Bindings for structure SDL_CD
thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
Structure
thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
Mouse
thumbSDL::Mouse- SDL Bindings for the Mouse device
Structure
thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
thumbSDL::Version- SDL Bindings for structure SDL_Version

Tutorials
thumbSDL::Tutorial introduction to Perl SDL
thumbSDL::Tutorial::Animation
thumbSDL::Tutorial::Images
thumbSDL::Tutorial::LunarLander a small tutorial on Perl SDL
thumbSDL::Tutorial::Pong
thumbSDL::Tutorial::Tetris

UNCATEGORIZED
thumbSDL::Cdrom a SDL perl extension for managing CD-ROM drives
thumbSDL::Cursor a SDL perl extension
thumbSDL::Font a SDL perl extension
thumbSDL::Game::Palette a perl extension
thumbSDL::MPEG a SDL perl extension
thumbSDL::Music a perl extension
thumbSDL::OpenGL a perl extension
thumbSDL::Palette a perl extension
thumbSDL::SFont a perl extension
thumbSDL::SMPEG a SDL perl extension
thumbSDL::Sound a perl extension
thumbSDL::TTFont a SDL perl extension
thumbSDL::Timer a SDL perl extension for managing timers.
thumbSDL::Tool::Font a perl extension
thumbSDL::Tool::Graphic