Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
ADDON::Interface_AudioEngine Struct Reference

#include <AudioEngine.h>

Static Public Member Functions

static void Init (AddonGlobalInterface *addonInterface)
 
static void DeInit (AddonGlobalInterface *addonInterface)
 
static AEChannel TranslateAEChannelToKodi (AudioEngineChannel channel)
 Translation functions to separate Kodi and addons.
 
static AudioEngineChannel TranslateAEChannelToAddon (AEChannel channel)
 
static AEDataFormat TranslateAEFormatToKodi (AudioEngineDataFormat format)
 
static AudioEngineDataFormat TranslateAEFormatToAddon (AEDataFormat format)
 
static AEStreamHandleaudioengine_make_stream (void *kodiBase, AUDIO_ENGINE_FORMAT *streamFormat, unsigned int options)
 
static void audioengine_free_stream (void *kodiBase, AEStreamHandle *streamHandle)
 
static bool get_current_sink_format (void *kodiBase, AUDIO_ENGINE_FORMAT *sinkFormat)
 
static unsigned int aestream_get_space (void *kodiBase, AEStreamHandle *streamHandle)
 
static unsigned int aestream_add_data (void *kodiBase, AEStreamHandle *streamHandle, uint8_t *const *data, unsigned int offset, unsigned int frames, double pts, bool hasDownmix, double centerMixLevel)
 
static double aestream_get_delay (void *kodiBase, AEStreamHandle *streamHandle)
 
static bool aestream_is_buffering (void *kodiBase, AEStreamHandle *streamHandle)
 
static double aestream_get_cache_time (void *kodiBase, AEStreamHandle *streamHandle)
 
static double aestream_get_cache_total (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_pause (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_resume (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_drain (void *kodiBase, AEStreamHandle *streamHandle, bool wait)
 
static bool aestream_is_draining (void *kodiBase, AEStreamHandle *streamHandle)
 
static bool aestream_is_drained (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_flush (void *kodiBase, AEStreamHandle *streamHandle)
 
static float aestream_get_volume (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_set_volume (void *kodiBase, AEStreamHandle *streamHandle, float volume)
 
static float aestream_get_amplification (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_set_amplification (void *kodiBase, AEStreamHandle *streamHandle, float amplify)
 
static unsigned int aestream_get_frame_size (void *kodiBase, AEStreamHandle *streamHandle)
 
static unsigned int aestream_get_channel_count (void *kodiBase, AEStreamHandle *streamHandle)
 
static unsigned int aestream_get_sample_rate (void *kodiBase, AEStreamHandle *streamHandle)
 
static AudioEngineDataFormat aestream_get_data_format (void *kodiBase, AEStreamHandle *streamHandle)
 
static double aestream_get_resample_ratio (void *kodiBase, AEStreamHandle *streamHandle)
 
static void aestream_set_resample_ratio (void *kodiBase, AEStreamHandle *streamHandle, double ratio)
 

Member Function Documentation

◆ aestream_add_data()

unsigned int ADDON::Interface_AudioEngine::aestream_add_data ( void * kodiBase,
AEStreamHandle * streamHandle,
uint8_t *const * data,
unsigned int offset,
unsigned int frames,
double pts,
bool hasDownmix,
double centerMixLevel )
static

Add planar or interleaved PCM data to the stream

Parameters
[in]dataarray of pointers to the planes
[in]offsetto frame in frames
[in]framesnumber of frames
Returns
The number of frames consumed

◆ aestream_drain()

void ADDON::Interface_AudioEngine::aestream_drain ( void * kodiBase,
AEStreamHandle * streamHandle,
bool wait )
static

Start draining the stream

Note
Once called AddData will not consume more data.

◆ aestream_flush()

void ADDON::Interface_AudioEngine::aestream_flush ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Flush all buffers dropping the audio data

◆ aestream_get_amplification()

float ADDON::Interface_AudioEngine::aestream_get_amplification ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Gets the stream's volume amplification in linear units.

Returns
The volume amplification factor between 1.0 and 1000.0

◆ aestream_get_cache_time()

double ADDON::Interface_AudioEngine::aestream_get_cache_time ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the time in seconds that it will take to underrun the cache if no sample is added.

Returns
seconds

◆ aestream_get_cache_total()

double ADDON::Interface_AudioEngine::aestream_get_cache_total ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the total time in seconds of the cache

Returns
seconds

◆ aestream_get_channel_count()

unsigned int ADDON::Interface_AudioEngine::aestream_get_channel_count ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the number of channels the stream is configured to accept

Returns
The channel count

◆ aestream_get_data_format()

AudioEngineDataFormat ADDON::Interface_AudioEngine::aestream_get_data_format ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Return the data format the stream has been configured with

Returns
The stream's data format (eg, AE_FMT_S16LE)

◆ aestream_get_delay()

double ADDON::Interface_AudioEngine::aestream_get_delay ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the time in seconds that it will take for the next added packet to be heard from the speakers.

Returns
seconds

◆ aestream_get_frame_size()

unsigned int ADDON::Interface_AudioEngine::aestream_get_frame_size ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the size of one audio frame in bytes (channelCount * resolution)

Returns
The size in bytes of one frame

◆ aestream_get_resample_ratio()

double ADDON::Interface_AudioEngine::aestream_get_resample_ratio ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Return the resample ratio

Note
This will return an undefined value if the stream is not resampling
Returns
the current resample ratio or undefined if the stream is not resampling

◆ aestream_get_sample_rate()

unsigned int ADDON::Interface_AudioEngine::aestream_get_sample_rate ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the stream's sample rate, if the stream is using a dynamic sample rate, this value will NOT reflect any changes made by calls to SetResampleRatio()

Returns
The stream's sample rate (eg, 48000)

◆ aestream_get_space()

unsigned int ADDON::Interface_AudioEngine::aestream_get_space ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns the amount of space available in the stream

Returns
The number of bytes AddData will consume

◆ aestream_get_volume()

float ADDON::Interface_AudioEngine::aestream_get_volume ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Return the stream's current volume level

Returns
The volume level between 0.0 and 1.0

◆ aestream_is_buffering()

bool ADDON::Interface_AudioEngine::aestream_is_buffering ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns if the stream is buffering

Returns
True if the stream is buffering

◆ aestream_is_drained()

bool ADDON::Interface_AudioEngine::aestream_is_drained ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns true if the is stream has finished draining

◆ aestream_is_draining()

bool ADDON::Interface_AudioEngine::aestream_is_draining ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Returns true if the is stream draining

◆ aestream_pause()

void ADDON::Interface_AudioEngine::aestream_pause ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Pauses the stream playback

◆ aestream_resume()

void ADDON::Interface_AudioEngine::aestream_resume ( void * kodiBase,
AEStreamHandle * streamHandle )
static

Resumes the stream after pausing

◆ aestream_set_amplification()

void ADDON::Interface_AudioEngine::aestream_set_amplification ( void * kodiBase,
AEStreamHandle * streamHandle,
float amplify )
static

Sets the stream's volume amplification in linear units.

Parameters
amplifyThe volume amplification factor between 1.0 and 1000.0

◆ aestream_set_resample_ratio()

void ADDON::Interface_AudioEngine::aestream_set_resample_ratio ( void * kodiBase,
AEStreamHandle * streamHandle,
double ratio )
static

Sets the resample ratio

Note
This function may return false if the stream is not resampling, if you wish to use this be sure to set the AESTREAM_FORCE_RESAMPLE option
Parameters
[in]ratiothe new sample rate ratio, calculated by ((double)desiredRate / (double)GetSampleRate())

◆ aestream_set_volume()

void ADDON::Interface_AudioEngine::aestream_set_volume ( void * kodiBase,
AEStreamHandle * streamHandle,
float volume )
static

Set the stream's volume level

Parameters
volumeThe new volume level between 0.0 and 1.0

◆ audioengine_free_stream()

void ADDON::Interface_AudioEngine::audioengine_free_stream ( void * kodiBase,
AEStreamHandle * streamHandle )
static

This method will remove the specified stream from the engine. For OSX/IOS this is essential to reconfigure the audio output.

Parameters
[in]streamHandleThe stream to be altered

◆ audioengine_make_stream()

AEStreamHandle * ADDON::Interface_AudioEngine::audioengine_make_stream ( void * kodiBase,
AUDIO_ENGINE_FORMAT * streamFormat,
unsigned int options )
static

Creates and returns a new handle to an IAEStream in the format specified, this function should never fail

Parameters
[in]streamFormatFormat to use for stream
[in]optionsA bit field of stream options (see: enum AEStreamOptions)
Returns
a new Handle to an IAEStream that will accept data in the requested format

◆ DeInit()

void ADDON::Interface_AudioEngine::DeInit ( AddonGlobalInterface * addonInterface)
static

◆ get_current_sink_format()

bool ADDON::Interface_AudioEngine::get_current_sink_format ( void * kodiBase,
AUDIO_ENGINE_FORMAT * sinkFormat )
static

Get the current sink data format

Parameters
[in]sinkFormatsink data format. For more details see AUDIO_ENGINE_FORMAT.
Returns
Returns true on success, else false.

◆ Init()

void ADDON::Interface_AudioEngine::Init ( AddonGlobalInterface * addonInterface)
static

◆ TranslateAEChannelToAddon()

AudioEngineChannel ADDON::Interface_AudioEngine::TranslateAEChannelToAddon ( AEChannel channel)
static

◆ TranslateAEChannelToKodi()

AEChannel ADDON::Interface_AudioEngine::TranslateAEChannelToKodi ( AudioEngineChannel channel)
static

Translation functions to separate Kodi and addons.

This thought to make it more safe for cases as something changed inside Kodi, addons overseen and breaks API, further to have on addons a better documentation about this parts.

◆ TranslateAEFormatToAddon()

AudioEngineDataFormat ADDON::Interface_AudioEngine::TranslateAEFormatToAddon ( AEDataFormat format)
static

◆ TranslateAEFormatToKodi()

AEDataFormat ADDON::Interface_AudioEngine::TranslateAEFormatToKodi ( AudioEngineDataFormat format)
static

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