MLT  7.28.0
mlt_audio.h
Go to the documentation of this file.
1 
23 #ifndef MLT_AUDIO_H
24 #define MLT_AUDIO_H
25 
26 #include "mlt_types.h"
27 
34 {
35  void *data;
36  int frequency;
38  int samples;
39  int channels;
43 };
44 
45 extern mlt_audio mlt_audio_new();
46 extern void mlt_audio_close(mlt_audio self);
48  mlt_audio self, void *data, int frequency, mlt_audio_format format, int samples, int channels);
50  void **data,
51  int *frequency,
52  mlt_audio_format *format,
53  int *samples,
54  int *channels);
55 extern void mlt_audio_alloc_data(mlt_audio self);
56 extern void mlt_audio_free_data(mlt_audio self);
60 extern void mlt_audio_get_planes(mlt_audio self, uint8_t **planes);
61 extern void mlt_audio_silence(mlt_audio self, int samples, int start);
62 extern void mlt_audio_shrink(mlt_audio self, int samples);
63 extern void mlt_audio_reverse(mlt_audio self);
64 extern void mlt_audio_copy(mlt_audio dst, mlt_audio src, int samples, int src_start, int dst_start);
65 extern int mlt_audio_calculate_frame_samples(float fps, int frequency, int64_t position);
66 extern int64_t mlt_audio_calculate_samples_to_position(float fps, int frequency, int64_t position);
67 extern const char *mlt_audio_format_name(mlt_audio_format format);
68 extern int mlt_audio_format_size(mlt_audio_format format, int samples, int channels);
69 extern const char *mlt_audio_channel_layout_name(mlt_channel_layout layout);
73 
74 #endif
const char * mlt_audio_channel_layout_name(mlt_channel_layout layout)
Get the short name for a channel layout.
Definition: mlt_audio.c:612
mlt_audio mlt_audio_new()
Allocate a new Audio object.
Definition: mlt_audio.c:35
Provides forward definitions of all public types.
mlt_channel_layout
Definition: mlt_types.h:70
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:269
mlt_audio_format
The set of supported audio formats.
Definition: mlt_types.h:60
Audio class.
Definition: mlt_audio.h:34
mlt_destructor release_data
Definition: mlt_audio.h:41
void mlt_audio_reverse(mlt_audio self)
Reverse the audio samples.
Definition: mlt_audio.c:345
int mlt_audio_calculate_size(mlt_audio self)
Calculate the number of bytes needed for the Audio data.
Definition: mlt_audio.c:168
mlt_audio_format format
Definition: mlt_audio.h:37
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.
Definition: mlt_audio.c:238
void * data
Definition: mlt_audio.h:35
int mlt_audio_plane_count(mlt_audio self)
Get the number of planes for the audio type.
Definition: mlt_audio.c:182
mlt_destructor close
Definition: mlt_audio.h:42
int channels
Definition: mlt_audio.h:39
mlt_channel_layout layout
Definition: mlt_audio.h:40
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.
Definition: mlt_audio.c:74
void mlt_audio_shrink(mlt_audio self, int samples)
Shrink the audio to the new number of samples.
Definition: mlt_audio.c:315
int mlt_audio_plane_size(mlt_audio self)
Get the size of an audio plane.
Definition: mlt_audio.c:210
void mlt_audio_close(mlt_audio self)
Destroy an audio object created by mlt_audio_new().
Definition: mlt_audio.c:48
int frequency
Definition: mlt_audio.h:36
int samples
Definition: mlt_audio.h:38
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.
Definition: mlt_audio.c:98
void mlt_audio_free_data(mlt_audio self)
Free the data field using the destructor function.
Definition: mlt_audio.c:148
void mlt_audio_alloc_data(mlt_audio self)
Allocate the data field based on the other properties of the Audio.
Definition: mlt_audio.c:125
const char * mlt_audio_format_name(mlt_audio_format format)
Get the short name for an audio format.
Definition: mlt_audio.c:555
int mlt_audio_channel_layout_channels(mlt_channel_layout layout)
Get the number of channels for a channel layout.
Definition: mlt_audio.c:700
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.
Definition: mlt_audio.c:443
mlt_channel_layout mlt_audio_channel_layout_default(int channels)
Get a default channel layout for a given number of channels.
Definition: mlt_audio.c:768
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.
Definition: mlt_audio.c:513
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.
Definition: mlt_audio.c:535
mlt_channel_layout mlt_audio_channel_layout_id(const char *name)
Get the id of channel layout from short name.
Definition: mlt_audio.c:680
int mlt_audio_format_size(mlt_audio_format format, int samples, int channels)
Get the amount of bytes needed for a block of audio.
Definition: mlt_audio.c:585
void mlt_audio_silence(mlt_audio self, int samples, int start)
Set a range of samples to silence.
Definition: mlt_audio.c:257