| 1 | package SDL2::AudioSpec { | ||
| 2 | use SDL2::Utils; | ||
| 3 | has | ||
| 4 | freq => 'int', | ||
| 5 | format => 'uint16', | ||
| 6 | channels => 'uint8', | ||
| 7 | silence => 'uint8', | ||
| 8 | samples => 'uint16', | ||
| 9 | padding => 'uint16', | ||
| 10 | size => 'uint32', | ||
| 11 | callback => 'opaque', # SDL_AudioCallback | ||
| 12 | userdata => 'opaque' # void * | ||
| 13 | ; | ||
| 14 | |||
| 15 | =encoding utf-8 | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | SDL2::AudioSpec - The Structure that Defines a Point with Integers | ||
| 20 | |||
| 21 | =head1 SYNOPSIS | ||
| 22 | |||
| 23 | use SDL2 qw[:all]; | ||
| 24 | # TODO: I need to whip up a quick example | ||
| 25 | |||
| 26 | =head1 DESCRIPTION | ||
| 27 | |||
| 28 | SDL2::AudioSpec | ||
| 29 | |||
| 30 | The calculated values in this structure are calculated by SDL_OpenAudio(). | ||
| 31 | |||
| 32 | For multi-channel audio, the default SDL channel mapping is: | ||
| 33 | |||
| 34 | * 2: FL FR (stereo) | ||
| 35 | * 3: FL FR LFE (2.1 surround) | ||
| 36 | * 4: FL FR BL BR (quad) | ||
| 37 | * 5: FL FR FC BL BR (quad + center) | ||
| 38 | * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) | ||
| 39 | * 7: FL FR FC LFE BC SL SR (6.1 surround) | ||
| 40 | * 8: FL FR FC LFE BL BR SL SR (7.1 surround) | ||
| 41 | |||
| 42 | =head1 Fields | ||
| 43 | |||
| 44 | =over | ||
| 45 | |||
| 46 | =item C<freq> - DSP frequency -- samples per second | ||
| 47 | |||
| 48 | =item C<format> - Audio data format | ||
| 49 | |||
| 50 | =item C<channels> - Number of channels: 1 mondo, 2 stereo | ||
| 51 | |||
| 52 | =item C<silence> - Audio buffer silence value (calculated) | ||
| 53 | |||
| 54 | =item C<samples> - Audio buffer size in sample FRAMES (total samples divided by channel count) | ||
| 55 | |||
| 56 | =item C<padding> - Necessary for some compile environments | ||
| 57 | |||
| 58 | =item C<size> - Audio buffer size in bytes (calculated) | ||
| 59 | |||
| 60 | =item C<callback> - Callback that feeds the audio device (undef to use C<SDL_QueueAudio( ... )>) | ||
| 61 | |||
| 62 | =item C<userdata> - Userdata passed to callback (ignored for undef callbacks) | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | =head1 AUTHOR | ||
| 67 | |||
| 68 | Sanko Robinson E<lt>sanko@cpan.orgE<gt> | ||
| 69 | |||
| 70 | =begin stopwords | ||
| 71 | |||
| 72 | |||
| 73 | =end stopwords | ||
| 74 | |||
| 75 | =cut | ||
| 76 | |||
| 77 | }; | ||
| 78 | 1; |