MLT  7.22.0
Public Member Functions | Data Fields
mlt_audio_s Struct Reference

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
 

Detailed Description

Audio class.

Audio is the data object that represents audio for a period of time.

Member Function Documentation

◆ mlt_audio_alloc_data()

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.

Parameters
selfthe Audio object

◆ mlt_audio_calculate_size()

int mlt_audio_calculate_size ( mlt_audio  self)

Calculate the number of bytes needed for the Audio data.

Parameters
selfthe Audio object
Returns
the number of bytes

◆ mlt_audio_close()

void mlt_audio_close ( mlt_audio  self)

Destroy an audio object created by mlt_audio_new().

Parameters
selfthe Audio object

◆ mlt_audio_free_data()

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.

Parameters
selfthe Audio object

◆ mlt_audio_get_planes()

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.

Parameters
selfthe Audio object
[out]planesthe array of pointers to populate

◆ mlt_audio_get_values()

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.

Parameters
selfthe Audio object
[out]datathe buffer that contains the audio data
[out]frequencythe sample rate
[out]formatthe audio format
[out]samplesthe number of samples in the data
[out]channelsthe number of audio channels

◆ mlt_audio_plane_count()

int mlt_audio_plane_count ( mlt_audio  self)

Get the number of planes for the audio type.

Parameters
selfthe Audio object
Returns
the number of planes.

◆ mlt_audio_plane_size()

int mlt_audio_plane_size ( mlt_audio  self)

Get the size of an audio plane.

Parameters
selfthe Audio object
Returns
the size of a plane.

◆ mlt_audio_reverse()

void mlt_audio_reverse ( mlt_audio  self)

Reverse the audio samples.

Parameters
selfthe Audio object

◆ mlt_audio_set_values()

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.

Parameters
selfthe Audio object
datathe buffer that contains the audio data
frequencythe sample rate
formatthe audio format
samplesthe number of samples in the data
channelsthe number of audio channels

◆ mlt_audio_shrink()

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.

Parameters
selfthe Audio object
samplesthe new number of samples to shrink to

Field Documentation

◆ channels

int mlt_audio_s::channels

◆ close

mlt_destructor mlt_audio_s::close

◆ data

void* mlt_audio_s::data

◆ format

mlt_audio_format mlt_audio_s::format

◆ frequency

int mlt_audio_s::frequency

◆ layout

mlt_channel_layout mlt_audio_s::layout

◆ release_data

mlt_destructor mlt_audio_s::release_data

◆ samples

int mlt_audio_s::samples

The documentation for this struct was generated from the following files: