| 1 | package SDL2::AudioCVT { | ||
| 2 | use SDL2::Utils; | ||
| 3 | has | ||
| 4 | needed => 'int', | ||
| 5 | src_format => 'uint16', # SDL_AudioFormat | ||
| 6 | dst_format => 'uint16', # SDL_AudioFormat | ||
| 7 | rate_incr => 'double', | ||
| 8 | buf => 'opaque', # uint8 * | ||
| 9 | len => 'int', | ||
| 10 | len_cvt => 'int', | ||
| 11 | len_mult => 'int', | ||
| 12 | len_ratio => 'double', | ||
| 13 | filters => 'opaque', #SDL_AudioFilter[SDL_AUDIOCVT_MAX_FILTERS + 1]; | ||
| 14 | filter_index => 'int'; | ||
| 15 | |||
| 16 | =encoding utf-8 | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | SDL2::AudioCVT - The Structure that Holds a Set of Audio Conversion Filters | ||
| 21 | |||
| 22 | =head1 SYNOPSIS | ||
| 23 | |||
| 24 | use SDL2 qw[:all]; | ||
| 25 | # TODO: I need to whip up a quick example | ||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | SDL2::AudioCVT is a structure to hold a set of audio conversion filters and | ||
| 30 | buffers. | ||
| 31 | |||
| 32 | Note that various parts of the conversion pipeline can take advantage of SIMD | ||
| 33 | operations (like SSE2, for example). SDL2::AudioCVT doesn't require you to pass | ||
| 34 | it aligned data, but can possibly run much faster if you set both its (C<buf>) | ||
| 35 | field to a pointer that is aligned to 16 bytes, and its (C<len>) field to | ||
| 36 | something that's a multiple of 16, if possible. | ||
| 37 | |||
| 38 | =head1 Fields | ||
| 39 | |||
| 40 | =over | ||
| 41 | |||
| 42 | =item C<needed> - Set to 1 if conversion possible | ||
| 43 | |||
| 44 | =item C<src_format> - Source audio format | ||
| 45 | |||
| 46 | =item C<dst_format> - Target audio format | ||
| 47 | |||
| 48 | =item C<rate_incr> - Rate conversion increment | ||
| 49 | |||
| 50 | =item C<buf> - Buffer to hold entire audio data | ||
| 51 | |||
| 52 | =item C<len> - Length of original audio buffer | ||
| 53 | |||
| 54 | =item C<len_cvt> - Length of converted audio buffer | ||
| 55 | |||
| 56 | =item C<len_mult> - Buffer must be C<len * len_mult> big | ||
| 57 | |||
| 58 | =item C<len_ratio> - Given C<len>, final size is C<len * len_ratio> | ||
| 59 | |||
| 60 | =item C<filters> - List of filter functions | ||
| 61 | |||
| 62 | =item C<filter_index> - Current audio conversion function | ||
| 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; |