Data Structures | |
union | gavl_audio_samples_t |
Container for interleaved audio samples. More... | |
union | gavl_audio_channels_t |
Container for noninterleaved audio samples. More... | |
struct | gavl_audio_frame_t |
Generic container for audio samples. More... | |
Functions | |
GAVL_PUBLIC gavl_audio_frame_t * | gavl_audio_frame_create (const gavl_audio_format_t *format) |
Create audio frame. | |
GAVL_PUBLIC void | gavl_audio_frame_null (gavl_audio_frame_t *frame) |
Zero all pointers in the audio frame. | |
GAVL_PUBLIC void | gavl_audio_frame_destroy (gavl_audio_frame_t *frame) |
Destroy an audio frame. | |
GAVL_PUBLIC void | gavl_audio_frame_mute (gavl_audio_frame_t *frame, const gavl_audio_format_t *format) |
Mute an audio frame. | |
GAVL_PUBLIC void | gavl_audio_frame_mute_samples (gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int num_samples) |
Mute a number of samples at the start of an audio frame. | |
GAVL_PUBLIC void | gavl_audio_frame_mute_channel (gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int channel) |
Mute a single channel of an audio frame. | |
GAVL_PUBLIC int | gavl_audio_frame_copy (const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src, int dst_pos, int src_pos, int dst_size, int src_size) |
Copy audio data from one frame to another. | |
GAVL_PUBLIC void | gavl_audio_frame_copy_ptrs (const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src) |
Copy audio data from one frame to another. | |
GAVL_PUBLIC void | gavl_audio_frame_get_subframe (const gavl_audio_format_t *format, gavl_audio_frame_t *src, gavl_audio_frame_t *dst, int start, int len) |
Set an audio frame to a subframe of another frame. | |
GAVL_PUBLIC int | gavl_audio_frames_equal (const gavl_audio_format_t *format, const gavl_audio_frame_t *f1, const gavl_audio_frame_t *f2) |
Check if 2 audio frames are bit-identical. | |
GAVL_PUBLIC int | gavl_audio_frame_continuous (const gavl_audio_format_t *format, const gavl_audio_frame_t *f) |
Check if an audio frames is continuous in memory. | |
GAVL_PUBLIC void | gavl_audio_frame_set_channels (gavl_audio_frame_t *f, const gavl_audio_format_t *format, uint8_t *data) |
Set the channel pointers of an audio frame. | |
GAVL_PUBLIC int | gavl_audio_frame_skip (const gavl_audio_format_t *format, gavl_audio_frame_t *f, int num_samples) |
Skip samples in am audio frame. | |
GAVL_PUBLIC int | gavl_audio_frame_plot (const gavl_audio_format_t *format, const gavl_audio_frame_t *frame, const char *name_base) |
Plot an audio frame to an ASCII file. |
GAVL_PUBLIC gavl_audio_frame_t* gavl_audio_frame_create | ( | const gavl_audio_format_t * | format | ) |
Create audio frame.
format | Format of the data to be stored in this frame or NULL |
GAVL_PUBLIC void gavl_audio_frame_null | ( | gavl_audio_frame_t * | frame | ) |
Zero all pointers in the audio frame.
frame | An audio frame |
GAVL_PUBLIC void gavl_audio_frame_destroy | ( | gavl_audio_frame_t * | frame | ) |
Destroy an audio frame.
frame | An audio frame |
GAVL_PUBLIC void gavl_audio_frame_mute | ( | gavl_audio_frame_t * | frame, | |
const gavl_audio_format_t * | format | |||
) |
Mute an audio frame.
frame | An audio frame | |
format | The format of the frame |
GAVL_PUBLIC void gavl_audio_frame_mute_samples | ( | gavl_audio_frame_t * | frame, | |
const gavl_audio_format_t * | format, | |||
int | num_samples | |||
) |
Mute a number of samples at the start of an audio frame.
frame | An audio frame | |
format | The format of the frame | |
num_samples | Number of samples to mute |
GAVL_PUBLIC void gavl_audio_frame_mute_channel | ( | gavl_audio_frame_t * | frame, | |
const gavl_audio_format_t * | format, | |||
int | channel | |||
) |
Mute a single channel of an audio frame.
frame | An audio frame | |
format | The format of the frame | |
channel | The channel to mute |
GAVL_PUBLIC int gavl_audio_frame_copy | ( | const gavl_audio_format_t * | format, | |
gavl_audio_frame_t * | dst, | |||
const gavl_audio_frame_t * | src, | |||
int | dst_pos, | |||
int | src_pos, | |||
int | dst_size, | |||
int | src_size | |||
) |
Copy audio data from one frame to another.
format | Format, must be equal for source and destination frames | |
dst | Destination frame | |
src | Source frame | |
dst_pos | Offset (in samples) in the destination frame | |
src_pos | Offset (in samples) in the source frame | |
dst_size | Available samples in the destination frame | |
src_size | Available samples in the source frame |
You can use this function for creating a simple but effective audio buffer.
GAVL_PUBLIC void gavl_audio_frame_copy_ptrs | ( | const gavl_audio_format_t * | format, | |
gavl_audio_frame_t * | dst, | |||
const gavl_audio_frame_t * | src | |||
) |
Copy audio data from one frame to another.
format | Format, must be equal for source and destination frames | |
dst | Destination frame | |
src | Source frame |
Since 1.1.1
GAVL_PUBLIC void gavl_audio_frame_get_subframe | ( | const gavl_audio_format_t * | format, | |
gavl_audio_frame_t * | src, | |||
gavl_audio_frame_t * | dst, | |||
int | start, | |||
int | len | |||
) |
Set an audio frame to a subframe of another frame.
format | Format | |
src | Source frame | |
dst | Destination frame | |
start | Start position in the source frame | |
len | Length in samples |
Since 1.1.2
GAVL_PUBLIC int gavl_audio_frames_equal | ( | const gavl_audio_format_t * | format, | |
const gavl_audio_frame_t * | f1, | |||
const gavl_audio_frame_t * | f2 | |||
) |
Check if 2 audio frames are bit-identical.
format | Format | |
f1 | First frame | |
f2 | Second frame |
GAVL_PUBLIC int gavl_audio_frame_continuous | ( | const gavl_audio_format_t * | format, | |
const gavl_audio_frame_t * | f | |||
) |
Check if an audio frames is continuous in memory.
format | Format | |
f | Frame |
GAVL_PUBLIC void gavl_audio_frame_set_channels | ( | gavl_audio_frame_t * | f, | |
const gavl_audio_format_t * | format, | |||
uint8_t * | data | |||
) |
Set the channel pointers of an audio frame.
f | Frame | |
format | Format | |
data | Address of the first sample of the first channel |
GAVL_PUBLIC int gavl_audio_frame_skip | ( | const gavl_audio_format_t * | format, | |
gavl_audio_frame_t * | f, | |||
int | num_samples | |||
) |
Skip samples in am audio frame.
format | Format | |
f | Audio frame | |
num_samples | Number of samples skipped |
Since 1.5.0
GAVL_PUBLIC int gavl_audio_frame_plot | ( | const gavl_audio_format_t * | format, | |
const gavl_audio_frame_t * | frame, | |||
const char * | name_base | |||
) |
Plot an audio frame to an ASCII file.
format | Format | |
frame | An audio frame | |
name_base | Filename base |
In addition, a file for making a plot with gnuplot is generated. name_base is used for generating the filenames. For the data file, the extension ".dat" is appended. For the gnuplot file it's ".gnu"
Since 1.2.0