SDL_AudioCVT - Online Linux Manual PageSection : 3
Updated : Tue 11 Sep 2001, 22:58
Source : SDL
Note : SDL API Reference
NAMESDL_AudioCVT − Audio Conversion Structure
STRUCTURE DEFINITIONtypedef struct{
int needed;
Uint16 src_format;
Uint16 dest_format;
double rate_incr;
Uint8 *buf;
int len;
int len_cvt;
int len_mult;
double len_ratio;
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
int filter_index;
} SDL_AudioCVT;
STRUCTURE DATAneeded Set to one if the conversion is possible src_format Audio format of the source dest_format Audio format of the destination rate_incr Rate conversion increment buf Audio buffer len Length of the original audio buffer in bytes len_cvt Length of converted audio buffer in bytes (calculated) len_mult buf must be len*len_mult bytes in size(calculated) len_ratio Final audio size is len*len_ratio filters[10](..) Pointers to functions needed for this conversion filter_index Current conversion function
DESCRIPTIONThe SDL_AudioCVT is used to convert audio data between different formats. A SDL_AudioCVT structure is created with the SDL_BuildAudioCVT function, while the actual conversion is done by the SDL_ConvertAudio function. Many of the fields in the SDL_AudioCVT structure should be considered private and their function will not be discussed here. .IP "Uint8 *buf" 10This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure buf is large enough. See below. .IP "int len" 10This is the length of the original audio data in bytes. .IP "int len_mult" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of buf should be len*len_mult. .IP "double len_ratio" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid. len*len_ratio is the size of the converted audio data in bytes. This is very similar to len_mult, however when the convert audio data is shorter than the original len_mult would be 1. len_ratio, on the other hand, would be a fractional number between 0 and 1.
SEE ALSOSDL_BuildAudioCVT, SDL_ConvertAudio, SDL_AudioSpec 0
Johanes Gumabo
Data Size : 11,269 byte
man-SDL_AudioCVT.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 5 / 173,744
Visitor ID : :
Visitor IP : 18.116.20.205 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (rof_IP|5|SDL_AudioCVT.3|61|67|.IP "\fBUint8 *\fP\fBbuf\fR" 10This points to the audio data that will be used in the conversion\&. It is both the source and the destination, which means the converted audio data overwrites the original data\&. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure \fBbuf\fR is large enough\&. See below\&.
) (rof_IP|5|SDL_AudioCVT.3|62|13|.IP "\fBint\fP \fBlen\fR" 10This is the length of the original audio data in bytes\&.
) (rof_IP|5|SDL_AudioCVT.3|63|34|.IP "\fBint\fP \fBlen_mult\fR" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data\&. The length of \fBbuf\fR should be \fBlen\fR*\fBlen_mult\fR\&.
) (rof_IP|5|SDL_AudioCVT.3|64|68|.IP "\fBdouble\fP \fBlen_ratio\fR" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid\&. \fBlen\fR*\fBlen_ratio\fR is the size of the converted audio data in bytes\&. This is very similar to \fBlen_mult\fR, however when the convert audio data is shorter than the original \fBlen_mult\fR would be 1\&. \fBlen_ratio\fR, on the other hand, would be a fractional number between 0 and 1\&.
)