MLT
7.28.0
|
Audio class. More...
#include <mlt_audio.h>
Public Member Functions | |
void | mlt_audio_alloc_data (mlt_audio self) |
Allocate the data field based on the other properties of the Audio. More... | |
int | mlt_audio_calculate_size (mlt_audio self) |
Calculate the number of bytes needed for the Audio data. More... | |
void | mlt_audio_close (mlt_audio self) |
Destroy an audio object created by mlt_audio_new(). More... | |
void | mlt_audio_free_data (mlt_audio self) |
Free the data field using the destructor function. More... | |
void | mlt_audio_get_planes (mlt_audio self, uint8_t **planes) |
Populate an array of pointers each pointing to the beginning of an audio plane. More... | |
void | mlt_audio_get_values (mlt_audio self, void **data, int *frequency, mlt_audio_format *format, int *samples, int *channels) |
Get the most common values for the audio. More... | |
int | mlt_audio_plane_count (mlt_audio self) |
Get the number of planes for the audio type. More... | |
int | mlt_audio_plane_size (mlt_audio self) |
Get the size of an audio plane. More... | |
void | mlt_audio_reverse (mlt_audio self) |
Reverse the audio samples. More... | |
void | mlt_audio_set_values (mlt_audio self, void *data, int frequency, mlt_audio_format format, int samples, int channels) |
Set the most common values for the audio. More... | |
void | mlt_audio_shrink (mlt_audio self, int samples) |
Shrink the audio to the new number of samples. More... | |
Data Fields | |
int | channels |
mlt_destructor | close |
void * | data |
mlt_audio_format | format |
int | frequency |
mlt_channel_layout | layout |
mlt_destructor | release_data |
int | samples |
Audio class.
Audio is the data object that represents audio for a period of time.
void mlt_audio_alloc_data | ( | mlt_audio | self | ) |
Allocate the data field based on the other properties of the Audio.
If the data field is already set, and a destructor function exists, the data will be released. Else, the data pointer will be overwritten without being released.
After this function call, the release_data field will be set and can be used to release the data when necessary.
self | the Audio object |
int mlt_audio_calculate_size | ( | mlt_audio | self | ) |
Calculate the number of bytes needed for the Audio data.
self | the Audio object |
void mlt_audio_close | ( | mlt_audio | self | ) |
Destroy an audio object created by mlt_audio_new().
self | the Audio object |
void mlt_audio_free_data | ( | mlt_audio | self | ) |
Free the data field using the destructor function.
If the constructor function does not exist, the value will be set to NULL without being released.
After this function call, the data and release_data fields will be NULL.
self | the Audio object |
void mlt_audio_get_planes | ( | mlt_audio | self, |
uint8_t ** | planes | ||
) |
Populate an array of pointers each pointing to the beginning of an audio plane.
self | the Audio object | |
[out] | planes | the array of pointers to populate |
void mlt_audio_get_values | ( | mlt_audio | self, |
void ** | data, | ||
int * | frequency, | ||
mlt_audio_format * | format, | ||
int * | samples, | ||
int * | channels | ||
) |
Get the most common values for the audio.
self | the Audio object | |
[out] | data | the buffer that contains the audio data |
[out] | frequency | the sample rate |
[out] | format | the audio format |
[out] | samples | the number of samples in the data |
[out] | channels | the number of audio channels |
int mlt_audio_plane_count | ( | mlt_audio | self | ) |
Get the number of planes for the audio type.
self | the Audio object |
int mlt_audio_plane_size | ( | mlt_audio | self | ) |
Get the size of an audio plane.
self | the Audio object |
void mlt_audio_reverse | ( | mlt_audio | self | ) |
Reverse the audio samples.
self | the Audio object |
void mlt_audio_set_values | ( | mlt_audio | self, |
void * | data, | ||
int | frequency, | ||
mlt_audio_format | format, | ||
int | samples, | ||
int | channels | ||
) |
Set the most common values for the audio.
Less common values will be set to reasonable defaults.
You should use the mlt_audio_calculate_frame_samples
to determine the number of samples you want.
self | the Audio object |
data | the buffer that contains the audio data |
frequency | the sample rate |
format | the audio format |
samples | the number of samples in the data |
channels | the number of audio channels |
void mlt_audio_shrink | ( | mlt_audio | self, |
int | samples | ||
) |
Shrink the audio to the new number of samples.
Existing samples will be moved as necessary to ensure that the audio planes immediately follow each other. The samples field will be updated to match the new number.
self | the Audio object |
samples | the new number of samples to shrink to |
int mlt_audio_s::channels |
mlt_destructor mlt_audio_s::close |
void* mlt_audio_s::data |
mlt_audio_format mlt_audio_s::format |
int mlt_audio_s::frequency |
mlt_channel_layout mlt_audio_s::layout |
mlt_destructor mlt_audio_s::release_data |
int mlt_audio_s::samples |