|
MLT
7.38.0
Multimedia Framework
|
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_frame_samples (float fps, int frequency, int64_t position) |
| Determine the number of samples that belong in a frame at a time position. More... | |
| int64_t | mlt_audio_calculate_samples_to_position (float fps, int frequency, int64_t position) |
| Determine the number of samples that belong before a time position. More... | |
| int | mlt_audio_calculate_size (mlt_audio self) |
| Calculate the number of bytes needed for the Audio data. More... | |
| int | mlt_audio_channel_layout_channels (mlt_channel_layout layout) |
| Get the number of channels for a channel layout. More... | |
| mlt_channel_layout | mlt_audio_channel_layout_default (int channels) |
| Get a default channel layout for a given number of channels. More... | |
| mlt_channel_layout | mlt_audio_channel_layout_id (const char *name) |
| Get the id of channel layout from short name. More... | |
| const char * | mlt_audio_channel_layout_name (mlt_channel_layout layout) |
| Get the short name for a channel layout. More... | |
| void | mlt_audio_close (mlt_audio self) |
| Destroy an audio object created by mlt_audio_new(). More... | |
| void | mlt_audio_copy (mlt_audio dst, mlt_audio src, int samples, int src_start, int dst_start) |
| Copy audio samples from src to dst. More... | |
| const char * | mlt_audio_format_name (mlt_audio_format format) |
| Get the short name for an audio format. More... | |
| int | mlt_audio_format_size (mlt_audio_format format, int samples, int channels) |
| Get the amount of bytes needed for a block of audio. 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... | |
| void | mlt_audio_silence (mlt_audio self, int samples, int start) |
| Set a range of samples to silence. 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_frame_samples | ( | float | fps, |
| int | frequency, | ||
| int64_t | position | ||
| ) |
Determine the number of samples that belong in a frame at a time position.
| fps | the frame rate |
| frequency | the sample rate |
| position | the time position |
| int64_t mlt_audio_calculate_samples_to_position | ( | float | fps, |
| int | frequency, | ||
| int64_t | position | ||
| ) |
Determine the number of samples that belong before a time position.
| fps | the frame rate |
| frequency | the sample rate |
| position | the time position |
| int mlt_audio_calculate_size | ( | mlt_audio | self | ) |
Calculate the number of bytes needed for the Audio data.
| self | the Audio object |
| int mlt_audio_channel_layout_channels | ( | mlt_channel_layout | layout | ) |
Get the number of channels for a channel layout.
| layout | the channel layout |
| mlt_channel_layout mlt_audio_channel_layout_default | ( | int | channels | ) |
Get a default channel layout for a given number of channels.
| channels | the number of channels |
| mlt_channel_layout mlt_audio_channel_layout_id | ( | const char * | name | ) |
Get the id of channel layout from short name.
| name | the channel layout short name |
| const char * mlt_audio_channel_layout_name | ( | mlt_channel_layout | layout | ) |
Get the short name for a channel layout.
You do not need to deallocate the returned string.
| layout | the channel layout |
| void mlt_audio_close | ( | mlt_audio | self | ) |
Destroy an audio object created by mlt_audio_new().
| self | the Audio object |
Copy audio samples from src to dst.
| dst | the destination object |
| src | the source object |
| samples | the number of samples to copy |
| src_start | the number of samples to skip from the source |
| dst_start | the number of samples to skip from the destination |
| const char * mlt_audio_format_name | ( | mlt_audio_format | format | ) |
Get the short name for an audio format.
You do not need to deallocate the returned string.
| format | an audio format enum |
| int mlt_audio_format_size | ( | mlt_audio_format | format, |
| int | samples, | ||
| int | channels | ||
| ) |
Get the amount of bytes needed for a block of audio.
| format | an audio format enum |
| samples | the number of samples per channel |
| channels | the number of channels |
| 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 |
| void mlt_audio_silence | ( | mlt_audio | self, |
| int | samples, | ||
| int | start | ||
| ) |
Set a range of samples to silence.
| self | the Audio object |
| samples | the number of samples to silence |
| start | the sample at which to begin the silence |
| 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 |