QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LibVLC audio controls

Typedefs

typedef enum
libvlc_audio_output_device_types_t 
libvlc_audio_output_device_types_t
 
typedef enum
libvlc_audio_output_channel_t 
libvlc_audio_output_channel_t
 

Enumerations

enum  libvlc_audio_output_device_types_t {
  libvlc_AudioOutputDevice_Error = -1, libvlc_AudioOutputDevice_Mono = 1, libvlc_AudioOutputDevice_Stereo = 2, libvlc_AudioOutputDevice_2F2R = 4,
  libvlc_AudioOutputDevice_3F2R = 5, libvlc_AudioOutputDevice_5_1 = 6, libvlc_AudioOutputDevice_6_1 = 7, libvlc_AudioOutputDevice_7_1 = 8,
  libvlc_AudioOutputDevice_SPDIF = 10
}
 
enum  libvlc_audio_output_channel_t {
  libvlc_AudioChannel_Error = -1, libvlc_AudioChannel_Stereo = 1, libvlc_AudioChannel_RStereo = 2, libvlc_AudioChannel_Left = 3,
  libvlc_AudioChannel_Right = 4, libvlc_AudioChannel_Dolbys = 5
}
 

Functions

LIBVLC_API libvlc_audio_output_tlibvlc_audio_output_list_get (libvlc_instance_t *p_instance)
 
LIBVLC_API void libvlc_audio_output_list_release (libvlc_audio_output_t *p_list)
 
LIBVLC_API int libvlc_audio_output_set (libvlc_media_player_t *p_mi, const char *psz_name)
 
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_device_count (libvlc_instance_t *, const char *)
 
LIBVLC_DEPRECATED LIBVLC_API char * libvlc_audio_output_device_longname (libvlc_instance_t *, const char *, int)
 
LIBVLC_DEPRECATED LIBVLC_API char * libvlc_audio_output_device_id (libvlc_instance_t *, const char *, int)
 
LIBVLC_API
libvlc_audio_output_device_t
libvlc_audio_output_device_list_get (libvlc_instance_t *p_instance, const char *aout)
 
LIBVLC_API void libvlc_audio_output_device_list_release (libvlc_audio_output_device_t *p_list)
 
LIBVLC_API void libvlc_audio_output_device_set (libvlc_media_player_t *p_mi, const char *psz_audio_output, const char *psz_device_id)
 
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_get_device_type (libvlc_media_player_t *p_mi)
 
LIBVLC_DEPRECATED LIBVLC_API void libvlc_audio_output_set_device_type (libvlc_media_player_t *, int)
 
LIBVLC_API void libvlc_audio_toggle_mute (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_get_mute (libvlc_media_player_t *p_mi)
 
LIBVLC_API void libvlc_audio_set_mute (libvlc_media_player_t *p_mi, int status)
 
LIBVLC_API int libvlc_audio_get_volume (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_set_volume (libvlc_media_player_t *p_mi, int i_volume)
 
LIBVLC_API int libvlc_audio_get_track_count (libvlc_media_player_t *p_mi)
 
LIBVLC_API
libvlc_track_description_t
libvlc_audio_get_track_description (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_get_track (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_set_track (libvlc_media_player_t *p_mi, int i_track)
 
LIBVLC_API int libvlc_audio_get_channel (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_set_channel (libvlc_media_player_t *p_mi, int channel)
 
LIBVLC_API int64_t libvlc_audio_get_delay (libvlc_media_player_t *p_mi)
 
LIBVLC_API int libvlc_audio_set_delay (libvlc_media_player_t *p_mi, int64_t i_delay)
 

Detailed Description

Typedef Documentation

Enumeration Type Documentation

Audio channels

Audio device types

Function Documentation

LIBVLC_API int libvlc_audio_get_channel ( libvlc_media_player_t *  p_mi)

Get current audio channel.

Parameters
p_mimedia player
Returns
the audio channel
See also
libvlc_audio_output_channel_t
LIBVLC_API int64_t libvlc_audio_get_delay ( libvlc_media_player_t *  p_mi)

Get current audio delay.

Parameters
p_mimedia player
Returns
the audio delay (microseconds)
Version
LibVLC 1.1.1 or later
LIBVLC_API int libvlc_audio_get_mute ( libvlc_media_player_t *  p_mi)

Get current mute status.

Parameters
p_mimedia player
Returns
the mute status (boolean) if defined, -1 if undefined/unapplicable
LIBVLC_API int libvlc_audio_get_track ( libvlc_media_player_t *  p_mi)

Get current audio track.

Parameters
p_mimedia player
Returns
the audio track ID or -1 if no active input.
LIBVLC_API int libvlc_audio_get_track_count ( libvlc_media_player_t *  p_mi)

Get number of available audio tracks.

Parameters
p_mimedia player
Returns
the number of available audio tracks (int), or -1 if unavailable
LIBVLC_API libvlc_track_description_t* libvlc_audio_get_track_description ( libvlc_media_player_t *  p_mi)

Get the description of available audio tracks.

Parameters
p_mimedia player
Returns
list with description of available audio tracks, or NULL
LIBVLC_API int libvlc_audio_get_volume ( libvlc_media_player_t *  p_mi)

Get current software audio volume.

Parameters
p_mimedia player
Returns
the software volume in percents (0 = mute, 100 = nominal / 0dB)
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_device_count ( libvlc_instance_t ,
const char *   
)

Backward compatibility stub. Do not use in new code. Use libvlc_audio_output_device_list_get() instead.

Returns
always 0.
LIBVLC_DEPRECATED LIBVLC_API char* libvlc_audio_output_device_id ( libvlc_instance_t ,
const char *  ,
int   
)

Backward compatibility stub. Do not use in new code. Use libvlc_audio_output_device_list_get() instead.

Returns
always NULL.
LIBVLC_API libvlc_audio_output_device_t* libvlc_audio_output_device_list_get ( libvlc_instance_t p_instance,
const char *  aout 
)

Gets a list of audio output devices for a given audio output.

See also
libvlc_audio_output_device_set().
Note
Not all audio outputs support this. In particular, an empty (NULL) list of devices does not imply that the specified audio output does not work.
The list might not be exhaustive.
Warning
Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device.
Parameters
p_instancelibvlc instance
psz_aoutaudio output name (as returned by libvlc_audio_output_list_get())
Returns
A NULL-terminated linked list of potential audio output devices. It must be freed it with libvlc_audio_output_device_list_release()
Version
LibVLC 2.1.0 or later.
LIBVLC_API void libvlc_audio_output_device_list_release ( libvlc_audio_output_device_t p_list)

Frees a list of available audio output devices.

Parameters
p_listlist with audio outputs for release
Version
LibVLC 2.1.0 or later.
LIBVLC_DEPRECATED LIBVLC_API char* libvlc_audio_output_device_longname ( libvlc_instance_t ,
const char *  ,
int   
)

Backward compatibility stub. Do not use in new code. Use libvlc_audio_output_device_list_get() instead.

Returns
always NULL.
LIBVLC_API void libvlc_audio_output_device_set ( libvlc_media_player_t *  p_mi,
const char *  psz_audio_output,
const char *  psz_device_id 
)

Configures an explicit audio output device for a given audio output plugin. A list of possible devices can be obtained with libvlc_audio_output_device_list_get().

Note
This function does not select the specified audio output plugin. libvlc_audio_output_set() is used for that purpose.
Warning
The syntax for the device parameter depends on the audio output. This is not portable. Only use this function if you know what you are doing. Some audio outputs do not support this function (e.g. PulseAudio, WASAPI). Some audio outputs require further parameters (e.g. ALSA: channels map).
Parameters
p_mimedia player
psz_audio_output- name of audio output,
See also
libvlc_audio_output_t
Parameters
psz_device_iddevice
Returns
Nothing. Errors are ignored.
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_get_device_type ( libvlc_media_player_t *  p_mi)

Stub for backward compatibility.

Returns
always -1.
LIBVLC_API libvlc_audio_output_t* libvlc_audio_output_list_get ( libvlc_instance_t p_instance)

Gets the list of available audio outputs

Parameters
p_instancelibvlc instance
Returns
list of available audio outputs. It must be freed it with
See also
libvlc_audio_output_list_release
libvlc_audio_output_t . In case of error, NULL is returned.
LIBVLC_API void libvlc_audio_output_list_release ( libvlc_audio_output_t p_list)

Frees the list of available audio outputs

Parameters
p_listlist with audio outputs for release
LIBVLC_API int libvlc_audio_output_set ( libvlc_media_player_t *  p_mi,
const char *  psz_name 
)

Sets the audio output.

Note
Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing.
Parameters
p_mimedia player
psz_namename of audio output, use psz_name of
See also
libvlc_audio_output_t
Returns
0 if function succeded, -1 on error
LIBVLC_DEPRECATED LIBVLC_API void libvlc_audio_output_set_device_type ( libvlc_media_player_t *  ,
int   
)

Stub for backward compatibility.

LIBVLC_API int libvlc_audio_set_channel ( libvlc_media_player_t *  p_mi,
int  channel 
)

Set current audio channel.

Parameters
p_mimedia player
channelthe audio channel,
See also
libvlc_audio_output_channel_t
Returns
0 on success, -1 on error
LIBVLC_API int libvlc_audio_set_delay ( libvlc_media_player_t *  p_mi,
int64_t  i_delay 
)

Set current audio delay. The audio delay will be reset to zero each time the media changes.

Parameters
p_mimedia player
i_delaythe audio delay (microseconds)
Returns
0 on success, -1 on error
Version
LibVLC 1.1.1 or later
LIBVLC_API void libvlc_audio_set_mute ( libvlc_media_player_t *  p_mi,
int  status 
)

Set mute status.

Parameters
p_mimedia player
statusIf status is true then mute, otherwise unmute
Warning
This function does not always work. If there are no active audio playback stream, the mute status might not be available. If digital pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also some audio output plugins do not support muting at all.
Note
To force silent playback, disable all audio tracks. This is more efficient and reliable than mute.
LIBVLC_API int libvlc_audio_set_track ( libvlc_media_player_t *  p_mi,
int  i_track 
)

Set current audio track.

Parameters
p_mimedia player
i_trackthe track ID (i_id field from track description)
Returns
0 on success, -1 on error
LIBVLC_API int libvlc_audio_set_volume ( libvlc_media_player_t *  p_mi,
int  i_volume 
)

Set current software audio volume.

Parameters
p_mimedia player
i_volumethe volume in percents (0 = mute, 100 = 0dB)
Returns
0 if the volume was set, -1 if it was out of range
LIBVLC_API void libvlc_audio_toggle_mute ( libvlc_media_player_t *  p_mi)

Toggle mute status.

Parameters
p_mimedia player
Warning
Toggling mute atomically is not always possible: On some platforms, other processes can mute the VLC audio playback stream asynchronously. Thus, there is a small race condition where toggling will not work. See also the limitations of libvlc_audio_set_mute().