1SDL::AudioCVT(3) User Contributed Perl Documentation SDL::AudioCVT(3)
2
3
4
6 SDL::AudioCVT -- Audio Conversion Structure
7
9 Core, Audio, Structure
10
13 The "SDL::AudioCVT" is used to convert audio data between different
14 formats. A "SDL::AudioCVT" structure is created with the
15 "SDL::AudioCVT-"build> function, while the actual conversion is done by
16 the "SDL::Audio::convert_audio" function.
17
19 new
20 This constructor returns an empty "SDL::AudioCVT" structure.
21
22 build
23 $cvt = SDL::AudioCVT->build( $src_format, $src_channels, $src_rate
24 $dst_format, $dst_channels, $dst_rate );
25
26 Before an "SDL::AudioCVT" structure can be used to convert audio data
27 it must be initialized with source and destination information.
28
29 "src_format" and "dst_format" are the source and destination format of
30 the conversion. (For information on audio formats see
31 "SDL::AudioSpec"). "src_channels" and "dst_channels" are the number of
32 channels in the source and destination formats. Finally, "src_rate"
33 and "dst_rate" are the frequency or samples-per-second of the source
34 and destination formats. Once again, see "SDL::AudioSpec".
35
36 Currently (SDL-1.2.11) only rate conversions of 2x and (1/2)x with x >
37 0 are done, nearing the requested rate conversion.
38
39 See "SDL::Audio::convert_audio".
40
41 needed
42 Set to one if the conversion is possible
43
44 src_format
45 Audio format of the source
46
47 dest_format
48 Audio format of the destination
49
50 rate_incr
51 Rate conversion increment
52
53 len
54 Length of the original audio buffer in bytes
55
56 len_cvt
57 Length of converted audio buffer in bytes (calculated)
58
59 len_mult
60 "buf" must be "len*len_mult" bytes in size (calculated)
61
62 len_ratio
63 Final audio size is "len*len_ratio"
64
66 See "AUTHORS" in SDL.
67
68
69
70perl v5.34.0 2022-01-21 SDL::AudioCVT(3)