VLC  3.0.21
Typedefs | Enumerations | Functions
LibVLC audio controls
Collaboration diagram for LibVLC audio controls:

Typedefs

typedef enum libvlc_audio_output_device_types_t libvlc_audio_output_device_types_t
 Audio device types. More...
 
typedef enum libvlc_audio_output_channel_t libvlc_audio_output_channel_t
 Audio channels. More...
 
typedef enum libvlc_media_player_role libvlc_media_player_role_t
 Media player roles. More...
 

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
}
 Audio device types. More...
 
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
}
 Audio channels. More...
 
enum  libvlc_media_player_role {
  libvlc_role_None = 0, libvlc_role_Music, libvlc_role_Video, libvlc_role_Communication,
  libvlc_role_Game, libvlc_role_Notification, libvlc_role_Animation, libvlc_role_Production,
  libvlc_role_Accessibility
}
 Media player roles. More...
 

Functions

LIBVLC_API libvlc_audio_output_tlibvlc_audio_output_list_get (libvlc_instance_t *p_instance)
 Gets the list of available audio output modules. More...
 
LIBVLC_API void libvlc_audio_output_list_release (libvlc_audio_output_t *p_list)
 Frees the list of available audio output modules. More...
 
LIBVLC_API int libvlc_audio_output_set (libvlc_media_player_t *p_mi, const char *psz_name)
 Selects an audio output module. More...
 
LIBVLC_API libvlc_audio_output_device_tlibvlc_audio_output_device_enum (libvlc_media_player_t *mp)
 Gets a list of potential audio output devices,. More...
 
LIBVLC_API libvlc_audio_output_device_tlibvlc_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 module,. More...
 
LIBVLC_API void libvlc_audio_output_device_list_release (libvlc_audio_output_device_t *p_list)
 Frees a list of available audio output devices. More...
 
LIBVLC_API void libvlc_audio_output_device_set (libvlc_media_player_t *mp, const char *module, const char *device_id)
 Configures an explicit audio output device. More...
 
LIBVLC_API char * libvlc_audio_output_device_get (libvlc_media_player_t *mp)
 Get the current audio output device identifier. More...
 
LIBVLC_API void libvlc_audio_toggle_mute (libvlc_media_player_t *p_mi)
 Toggle mute status. More...
 
LIBVLC_API int libvlc_audio_get_mute (libvlc_media_player_t *p_mi)
 Get current mute status. More...
 
LIBVLC_API void libvlc_audio_set_mute (libvlc_media_player_t *p_mi, int status)
 Set mute status. More...
 
LIBVLC_API int libvlc_audio_get_volume (libvlc_media_player_t *p_mi)
 Get current software audio volume. More...
 
LIBVLC_API int libvlc_audio_set_volume (libvlc_media_player_t *p_mi, int i_volume)
 Set current software audio volume. More...
 
LIBVLC_API int libvlc_audio_get_track_count (libvlc_media_player_t *p_mi)
 Get number of available audio tracks. More...
 
LIBVLC_API libvlc_track_description_tlibvlc_audio_get_track_description (libvlc_media_player_t *p_mi)
 Get the description of available audio tracks. More...
 
LIBVLC_API int libvlc_audio_get_track (libvlc_media_player_t *p_mi)
 Get current audio track. More...
 
LIBVLC_API int libvlc_audio_set_track (libvlc_media_player_t *p_mi, int i_track)
 Set current audio track. More...
 
LIBVLC_API int libvlc_audio_get_channel (libvlc_media_player_t *p_mi)
 Get current audio channel. More...
 
LIBVLC_API int libvlc_audio_set_channel (libvlc_media_player_t *p_mi, int channel)
 Set current audio channel. More...
 
LIBVLC_API int64_t libvlc_audio_get_delay (libvlc_media_player_t *p_mi)
 Get current audio delay. More...
 
LIBVLC_API int libvlc_audio_set_delay (libvlc_media_player_t *p_mi, int64_t i_delay)
 Set current audio delay. More...
 
LIBVLC_API unsigned libvlc_audio_equalizer_get_preset_count (void)
 Get the number of equalizer presets. More...
 
const LIBVLC_API char * libvlc_audio_equalizer_get_preset_name (unsigned u_index)
 Get the name of a particular equalizer preset. More...
 
LIBVLC_API unsigned libvlc_audio_equalizer_get_band_count (void)
 Get the number of distinct frequency bands for an equalizer. More...
 
LIBVLC_API float libvlc_audio_equalizer_get_band_frequency (unsigned u_index)
 Get a particular equalizer band frequency. More...
 
LIBVLC_API libvlc_equalizer_tlibvlc_audio_equalizer_new (void)
 Create a new default equalizer, with all frequency values zeroed. More...
 
LIBVLC_API libvlc_equalizer_tlibvlc_audio_equalizer_new_from_preset (unsigned u_index)
 Create a new equalizer, with initial frequency values copied from an existing preset. More...
 
LIBVLC_API void libvlc_audio_equalizer_release (libvlc_equalizer_t *p_equalizer)
 Release a previously created equalizer instance. More...
 
LIBVLC_API int libvlc_audio_equalizer_set_preamp (libvlc_equalizer_t *p_equalizer, float f_preamp)
 Set a new pre-amplification value for an equalizer. More...
 
LIBVLC_API float libvlc_audio_equalizer_get_preamp (libvlc_equalizer_t *p_equalizer)
 Get the current pre-amplification value from an equalizer. More...
 
LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index (libvlc_equalizer_t *p_equalizer, float f_amp, unsigned u_band)
 Set a new amplification value for a particular equalizer frequency band. More...
 
LIBVLC_API float libvlc_audio_equalizer_get_amp_at_index (libvlc_equalizer_t *p_equalizer, unsigned u_band)
 Get the amplification value for a particular equalizer frequency band. More...
 
LIBVLC_API int libvlc_media_player_set_equalizer (libvlc_media_player_t *p_mi, libvlc_equalizer_t *p_equalizer)
 Apply new equalizer settings to a media player. More...
 
LIBVLC_API int libvlc_media_player_get_role (libvlc_media_player_t *p_mi)
 Gets the media role. More...
 
LIBVLC_API int libvlc_media_player_set_role (libvlc_media_player_t *p_mi, unsigned role)
 Sets the media role. More...
 
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_device_count (libvlc_instance_t *p_instance, const char *psz_audio_output)
 Backward compatibility stub. More...
 
LIBVLC_DEPRECATED LIBVLC_API char * libvlc_audio_output_device_longname (libvlc_instance_t *p_instance, const char *psz_output, int i_device)
 Backward compatibility stub. More...
 
LIBVLC_DEPRECATED LIBVLC_API char * libvlc_audio_output_device_id (libvlc_instance_t *p_instance, const char *psz_audio_output, int i_device)
 Backward compatibility stub. More...
 
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_get_device_type (libvlc_media_player_t *p_mi)
 Stub for backward compatibility. More...
 
LIBVLC_DEPRECATED LIBVLC_API void libvlc_audio_output_set_device_type (libvlc_media_player_t *p_mp, int device_type)
 Stub for backward compatibility. More...
 

Detailed Description

Typedef Documentation

◆ libvlc_audio_output_channel_t

Audio channels.

◆ libvlc_audio_output_device_types_t

Audio device types.

◆ libvlc_media_player_role_t

Media player roles.

Version
LibVLC 3.0.0 and later.

See libvlc_media_player_set_role()

Enumeration Type Documentation

◆ libvlc_audio_output_channel_t

Audio channels.

Enumerator
libvlc_AudioChannel_Error 
libvlc_AudioChannel_Stereo 
libvlc_AudioChannel_RStereo 
libvlc_AudioChannel_Left 
libvlc_AudioChannel_Right 
libvlc_AudioChannel_Dolbys 

◆ libvlc_audio_output_device_types_t

Audio device types.

Enumerator
libvlc_AudioOutputDevice_Error 
libvlc_AudioOutputDevice_Mono 
libvlc_AudioOutputDevice_Stereo 
libvlc_AudioOutputDevice_2F2R 
libvlc_AudioOutputDevice_3F2R 
libvlc_AudioOutputDevice_5_1 
libvlc_AudioOutputDevice_6_1 
libvlc_AudioOutputDevice_7_1 
libvlc_AudioOutputDevice_SPDIF 

◆ libvlc_media_player_role

Media player roles.

Version
LibVLC 3.0.0 and later.

See libvlc_media_player_set_role()

Enumerator
libvlc_role_None 

Don't use a media player role.

libvlc_role_Music 

Music (or radio) playback.

libvlc_role_Video 

Video playback.

libvlc_role_Communication 

Speech, real-time communication.

libvlc_role_Game 

Video game.

libvlc_role_Notification 

User interaction feedback.

libvlc_role_Animation 

Embedded animation (e.g.

in web page)

libvlc_role_Production 

Audio editting/production.

libvlc_role_Accessibility 

Accessibility.

Function Documentation

◆ libvlc_audio_equalizer_get_amp_at_index()

LIBVLC_API float libvlc_audio_equalizer_get_amp_at_index ( libvlc_equalizer_t p_equalizer,
unsigned  u_band 
)

Get the amplification value for a particular equalizer frequency band.

Parameters
p_equalizervalid equalizer handle, must not be NULL
u_bandindex, counting from zero, of the frequency band to get
Returns
amplification value (Hz); NaN if there is no such frequency band
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_get_band_count()

LIBVLC_API unsigned libvlc_audio_equalizer_get_band_count ( void  )

Get the number of distinct frequency bands for an equalizer.

Returns
number of frequency bands
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_get_band_frequency()

LIBVLC_API float libvlc_audio_equalizer_get_band_frequency ( unsigned  u_index)

Get a particular equalizer band frequency.

This value can be used, for example, to create a label for an equalizer band control in a user interface.

Parameters
u_indexindex of the band, counting from zero
Returns
equalizer band frequency (Hz), or -1 if there is no such band
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_get_preamp()

LIBVLC_API float libvlc_audio_equalizer_get_preamp ( libvlc_equalizer_t p_equalizer)

Get the current pre-amplification value from an equalizer.

Parameters
p_equalizervalid equalizer handle, must not be NULL
Returns
preamp value (Hz)
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_get_preset_count()

LIBVLC_API unsigned libvlc_audio_equalizer_get_preset_count ( void  )

Get the number of equalizer presets.

Returns
number of presets
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_get_preset_name()

const LIBVLC_API char* libvlc_audio_equalizer_get_preset_name ( unsigned  u_index)

Get the name of a particular equalizer preset.

This name can be used, for example, to prepare a preset label or menu in a user interface.

Parameters
u_indexindex of the preset, counting from zero
Returns
preset name, or NULL if there is no such preset
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_new()

LIBVLC_API libvlc_equalizer_t* libvlc_audio_equalizer_new ( void  )

Create a new default equalizer, with all frequency values zeroed.

The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer().

The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

Returns
opaque equalizer handle, or NULL on error
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_new_from_preset()

LIBVLC_API libvlc_equalizer_t* libvlc_audio_equalizer_new_from_preset ( unsigned  u_index)

Create a new equalizer, with initial frequency values copied from an existing preset.

The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer().

The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

Parameters
u_indexindex of the preset, counting from zero
Returns
opaque equalizer handle, or NULL on error
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_release()

LIBVLC_API void libvlc_audio_equalizer_release ( libvlc_equalizer_t p_equalizer)

Release a previously created equalizer instance.

The equalizer was previously created by using libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset().

It is safe to invoke this method with a NULL p_equalizer parameter for no effect.

Parameters
p_equalizeropaque equalizer handle, or NULL
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_set_amp_at_index()

LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index ( libvlc_equalizer_t p_equalizer,
float  f_amp,
unsigned  u_band 
)

Set a new amplification value for a particular equalizer frequency band.

The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer().

The supplied amplification value will be clamped to the -20.0 to +20.0 range.

Parameters
p_equalizervalid equalizer handle, must not be NULL
f_ampamplification value (-20.0 to 20.0 Hz)
u_bandindex, counting from zero, of the frequency band to set
Returns
zero on success, -1 on error
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_equalizer_set_preamp()

LIBVLC_API int libvlc_audio_equalizer_set_preamp ( libvlc_equalizer_t p_equalizer,
float  f_preamp 
)

Set a new pre-amplification value for an equalizer.

The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer().

The supplied amplification value will be clamped to the -20.0 to +20.0 range.

Parameters
p_equalizervalid equalizer handle, must not be NULL
f_preamppreamp value (-20.0 to 20.0 Hz)
Returns
zero on success, -1 on error
Version
LibVLC 2.2.0 or later

◆ libvlc_audio_get_channel()

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_audio_get_delay()

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_audio_get_mute()

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_audio_get_track()

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_audio_get_track_count()

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_audio_get_track_description()

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. It must be freed with libvlc_track_description_list_release()

◆ libvlc_audio_get_volume()

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_audio_output_device_count()

LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_device_count ( libvlc_instance_t p_instance,
const char *  psz_audio_output 
)

Backward compatibility stub.

Do not use in new code.

Deprecated:
Use libvlc_audio_output_device_list_get() instead.
Returns
always 0.

◆ libvlc_audio_output_device_enum()

LIBVLC_API libvlc_audio_output_device_t* libvlc_audio_output_device_enum ( libvlc_media_player_t mp)

Gets a list of potential audio output devices,.

See also
libvlc_audio_output_device_set().
Note
Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (NULL).
The list may 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
mpmedia player
Returns
A NULL-terminated linked list of potential audio output devices. It must be freed with libvlc_audio_output_device_list_release()
Version
LibVLC 2.2.0 or later.

◆ libvlc_audio_output_device_get()

LIBVLC_API char* libvlc_audio_output_device_get ( libvlc_media_player_t mp)

Get the current audio output device identifier.

This complements libvlc_audio_output_device_set().

Warning
The initial value for the current audio output device identifier may not be set or may be some unknown value. A LibVLC application should compare this value against the known device identifiers (e.g. those that were previously retrieved by a call to libvlc_audio_output_device_enum or libvlc_audio_output_device_list_get) to find the current audio output device.

It is possible that the selected audio output device changes (an external change) without a call to libvlc_audio_output_device_set. That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen.

Parameters
mpmedia player
Returns
the current audio output device identifier NULL if no device is selected or in case of error (the result must be released with free() or libvlc_free()).
Version
LibVLC 3.0.0 or later.

◆ libvlc_audio_output_device_id()

LIBVLC_DEPRECATED LIBVLC_API char* libvlc_audio_output_device_id ( libvlc_instance_t p_instance,
const char *  psz_audio_output,
int  i_device 
)

Backward compatibility stub.

Do not use in new code.

Deprecated:
Use libvlc_audio_output_device_list_get() instead.
Returns
always NULL.

◆ libvlc_audio_output_device_list_get()

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 module,.

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
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 with libvlc_audio_output_device_list_release()
Version
LibVLC 2.1.0 or later.

◆ libvlc_audio_output_device_list_release()

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_audio_output_device_longname()

LIBVLC_DEPRECATED LIBVLC_API char* libvlc_audio_output_device_longname ( libvlc_instance_t p_instance,
const char *  psz_output,
int  i_device 
)

Backward compatibility stub.

Do not use in new code.

Deprecated:
Use libvlc_audio_output_device_list_get() instead.
Returns
always NULL.

◆ libvlc_audio_output_device_set()

LIBVLC_API void libvlc_audio_output_device_set ( libvlc_media_player_t mp,
const char *  module,
const char *  device_id 
)

Configures an explicit audio output device.

If the module paramater is NULL, audio output will be moved to the device specified by the device identifier string immediately. This is the recommended usage.

A list of adequate potential device strings can be obtained with libvlc_audio_output_device_enum().

However passing NULL is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would have no effects when the module parameter was NULL.

If the module parameter is not NULL, the device parameter of the corresponding audio output, if it exists, will be set to the specified string. Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio).

A list of adequate potential device strings 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.

Some audio output modules require further parameters (e.g. a channels map in the case of ALSA).

Parameters
mpmedia player
moduleIf NULL, current audio output module. if non-NULL, name of audio output module (
See also
libvlc_audio_output_t)
Parameters
device_iddevice identifier string
Returns
Nothing. Errors are ignored (this is a design bug).

◆ libvlc_audio_output_get_device_type()

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_audio_output_list_get()

LIBVLC_API libvlc_audio_output_t* libvlc_audio_output_list_get ( libvlc_instance_t p_instance)

Gets the list of available audio output modules.

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

◆ libvlc_audio_output_list_release()

LIBVLC_API void libvlc_audio_output_list_release ( libvlc_audio_output_t p_list)

Frees the list of available audio output modules.

Parameters
p_listlist with audio outputs for release

◆ libvlc_audio_output_set()

LIBVLC_API int libvlc_audio_output_set ( libvlc_media_player_t p_mi,
const char *  psz_name 
)

Selects an audio output module.

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 succeeded, -1 on error

◆ libvlc_audio_output_set_device_type()

LIBVLC_DEPRECATED LIBVLC_API void libvlc_audio_output_set_device_type ( libvlc_media_player_t p_mp,
int  device_type 
)

Stub for backward compatibility.

◆ libvlc_audio_set_channel()

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_audio_set_delay()

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_audio_set_mute()

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_audio_set_track()

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_audio_set_volume()

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_audio_toggle_mute()

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().

◆ libvlc_media_player_get_role()

LIBVLC_API int libvlc_media_player_get_role ( libvlc_media_player_t p_mi)

Gets the media role.

Version
LibVLC 3.0.0 and later.
Parameters
p_mimedia player
Returns
the media player role (libvlc_media_player_role_t)

◆ libvlc_media_player_set_equalizer()

LIBVLC_API int libvlc_media_player_set_equalizer ( libvlc_media_player_t p_mi,
libvlc_equalizer_t p_equalizer 
)

Apply new equalizer settings to a media player.

The equalizer is first created by invoking libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset().

It is possible to apply new equalizer settings to a media player whether the media player is currently playing media or not.

Invoking this method will immediately apply the new equalizer settings to the audio output of the currently playing media if there is any.

If there is no currently playing media, the new equalizer settings will be applied later if and when new media is played.

Equalizer settings will automatically be applied to subsequently played media.

To disable the equalizer for a media player invoke this method passing NULL for the p_equalizer parameter.

The media player does not keep a reference to the supplied equalizer so it is safe for an application to release the equalizer reference any time after this method returns.

Parameters
p_miopaque media player handle
p_equalizeropaque equalizer handle, or NULL to disable the equalizer for this media player
Returns
zero on success, -1 on error
Version
LibVLC 2.2.0 or later

◆ libvlc_media_player_set_role()

LIBVLC_API int libvlc_media_player_set_role ( libvlc_media_player_t p_mi,
unsigned  role 
)

Sets the media role.

Parameters
p_mimedia player
rolethe media player role (libvlc_media_player_role_t)
Returns
0 on success, -1 on error