X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Audio.html-inc;h=b8c5b8f2b36ce32bcff7ed8a56580bb8ad2342bb;hb=d5943b684b1240307fbf0a103abbf18dd93998f4;hp=83e5a50ded25bfb92a2c8a328ae25e0766500529;hpb=15c551d8d343305c6a28bd6b9813c63b8420b954;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Audio.html-inc b/pages/SDL-Audio.html-inc index 83e5a50..b8c5b8f 100644 --- a/pages/SDL-Audio.html-inc +++ b/pages/SDL-Audio.html-inc @@ -4,6 +4,7 @@

NAME

Top

-

SDL::Audio -- SDL Bindings for Audio

+

SDL::Audio - SDL Bindings for Audio

CATEGORY

Top

-

TODO, Core, Audio

+

Core, Audio

+ +
+

CONSTANTS

Top

+
+

The constants are exported by default. You can avoid this by doing:

+
 use SDL::Audio ();
+
+
+

and access them directly:

+
 SDL::Audio::AUDIO_S16SYS;
+
+
+

or by choosing the export tags below:

+

Export tag: ':format'

+
 AUDIO_U8
+ AUDIO_S8
+ AUDIO_U16LSB
+ AUDIO_S16LSB
+ AUDIO_U16MSB
+ AUDIO_S16MSB
+ AUDIO_U16
+ AUDIO_S16 
+ AUDIO_U16SYS
+ AUDIO_S16SYS
+
+
+

Export tag: ':status'

+
 SDL_AUDIO_STOPPED
+ SDL_AUDIO_PLAYING
+ SDL_AUDIO_PAUSED
+
+

METHODS

Top

@@ -64,7 +98,7 @@ -
The desired audio format. See SDL::AudioSpec
+
The desired audio format. See SDL::AudioSpec
    $desired->format
 
@@ -100,7 +134,7 @@
 	

SDL::Audio::open reads these fields from the desired SDL::AudioSpec structure passed to the function and attempts to find an audio configuration matching your desired. As mentioned above, if the obtained parameter is NULL then SDL with convert from your desired audio settings to the hardware settings as it plays.

-

If obtained is NULL then the desired SDL::AudioSpec is your working specification, otherwise the obtained SDL::AudioSpec becomes the working specification and the desired specification can be deleted. The data in the working specification is used when building SDL::AudioCVT's for converting loaded data to the hardware format.

+

If obtained is NULL then the desired SDL::AudioSpec is your working specification, otherwise the obtained SDL::AudioSpec becomes the working specification and the desired specification can be deleted. The data in the working specification is used when building SDL::AudioCVT's for converting loaded data to the hardware format.

SDL::Audio::open calculates the size and silence fields for both the $desired and $obtained specifications. The size field stores the total size of the audio buffer in bytes, while the silence stores the value used to represent silence in the audio buffer

The audio device starts out playing silence when it's opened, and should be enabled for playing by calling SDL::Audio::pause(0) when you are ready for your audio callback function to be called. Since the audio driver may modify the requested size of the audio buffer, you should allocate any local mixing buffers after you open the audio device.

@@ -204,7 +238,6 @@ audio data in the buffer is equal to cvt->len*cvt->len_ratio. use SDL::Audio; use SDL::AudioSpec; use SDL::AudioCVT; - use Devel::Peek; SDL::init(SDL_INIT_AUDIO); @@ -294,4 +327,9 @@ function is not running. Do not call this from the callback function or you will

Shuts down audio processing and closes the audio device.

+

AUTHORS

Top

+
+

See AUTHORS in SDL.

+ +
\ No newline at end of file