pods::...udioCVT(3pm)

๐Ÿ“ฆ version 2.548, in opensuse-leap 16.0

pods::...udioCVT(3pm) ยท User Contributed Perl Documentation

๐ŸŽ€ NAME ๐ŸŽ€

SDL::AudioCVT -- Audio Conversion Structure. That's the whole name, bestie. ๐Ÿ’–

๐Ÿท๏ธ CATEGORY ๐Ÿท๏ธ

Core, Audio, Structure โ€” yes, it's giving core audio structure realness. โœจ

๐Ÿซฅ SYNOPSIS ๐Ÿซฅ

This section is literally empty in the original page โ€” no synopsis lines, no code, just a cute little blank space. ๐ŸŽ€

๐Ÿ’ฌ DESCRIPTION ๐Ÿ’ฌ

Okay so SDL::AudioCVT is the structure you use to convert audio data between different formats. It's not the converter itself โ€” it's the little info packet that tells the conversion what's up. ๐Ÿฆ‹

You create a SDL::AudioCVT structure with the SDL::AudioCVT->build function, and then the actual conversion is done by the SDL::Audio::convert_audio function. Teamwork, fr fr โ€” iykyk. ๐Ÿ’…

๐ŸŒธ METHODS ๐ŸŒธ

๐Ÿ’… new

This constructor returns an empty SDL::AudioCVT structure. Fresh out the box, no settings, just potential. โœจ

๐Ÿ› ๏ธ build

       $cvt = SDL::AudioCVT->build( $src_format, $src_channels, $src_rate
                                     $dst_format, $dst_channels, $dst_rate );

Before a SDL::AudioCVT structure can be used to convert audio data, it must be initialized with source and destination information. No initialization? No conversion. Periodt. ๐Ÿ’€

  • src_format and dst_format โ€” the source and destination format of the conversion. For info on audio formats, see SDL::AudioSpec. ๐Ÿ‘€
  • src_channels and dst_channels โ€” the number of channels in the source and destination formats. Channel count matters, bestie. ๐ŸŽš๏ธ
  • src_rate and dst_rate โ€” the frequency or samples-per-second of the source and destination formats. Once again, see SDL::AudioSpec. ๐ŸŽต
โš ๏ธ Caveat time: currently (SDL-1.2.11) only rate conversions of 2x and (1/2)x with x > 0 are done, nearing the requested rate conversion. So it's not out here doing every rate under the sun โ€” set your expectations accordingly. ๐ŸŒˆ

See SDL::Audio::convert_audio. ๐Ÿซถ

๐Ÿงฎ needed

Set to one if the conversion is possible. That's it โ€” one little flag, big main character energy. ๐Ÿ‘‘

๐ŸŽš๏ธ src_format

Audio format of the source. Easy. ๐Ÿ’–

๐ŸŽฏ dest_format

Audio format of the destination. Also easy. โœจ

๐Ÿ“ˆ rate_incr

Rate conversion increment. Increment-y. ๐Ÿ“Š

๐Ÿ“ len

Length of the original audio buffer in bytes. Byte count, no cap. ๐Ÿงฎ

๐Ÿ” len_cvt

Length of converted audio buffer in bytes (calculated). The math is mathing. ๐Ÿง 

๐Ÿงบ len_mult

buf must be len*len_mult bytes in size (calculated). Important sizing tea right here. ๐Ÿซ–

๐Ÿชž len_ratio

Final audio size is len*len_ratio. That's the ratio, bestie. ๐Ÿ’…

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

See "AUTHORS" in SDL. That's where the credit lives. ๐Ÿซถ


That's the whole page, bestie! ๐Ÿ’– This gem is from perl v5.42.0, dated 2024-05-01, and filed under pods::...udioCVT(3pm) โ€” mwah! ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from