天天看點

LibVLC audio controls

LibVLC audio controls

<a href="http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__media__player.html">LibVLC media player</a>

Collaboration diagram for LibVLC audio controls:

LibVLC audio controls

typedef enum 

<a href="http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html#ga059f2f96f5c47f3b7878e21b4d879613">libvlc_audio_output_device_types_t</a>

Audio device types. 

<a href="http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html#ga7f84a7c868f1111778ef7e9e30bc3690">libvlc_audio_output_channel_t</a>

Audio channels. 

enum  

}

Gets the list of available audio output modules. 

Frees the list of available audio output modules. 

Selects an audio output module. 

Backward compatibility stub. 

Gets a list of potential audio output devices,. 

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

Frees a list of available audio output devices. 

Configures an explicit audio output device. 

Stub for backward compatibility. 

Toggle mute status. 

Get current mute status. 

Set mute status. 

Get current software audio volume. 

Set current software audio volume. 

Get number of available audio tracks. 

Get the description of available audio tracks. 

Get current audio track. 

Set current audio track. 

Get current audio channel. 

Set current audio channel. 

Get current audio delay. 

Set current audio delay. 

Get the number of equalizer presets. 

Get the name of a particular equalizer preset. 

Get the number of distinct frequency bands for an equalizer. 

Get a particular equalizer band frequency. 

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

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

Release a previously created equalizer instance. 

Set a new pre-amplification value for an equalizer. 

Get the current pre-amplification value from an equalizer. 

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

Get the amplification value for a particular equalizer frequency band. 

Apply new equalizer settings to a media player. 

<a></a>

Audio channels.

Audio device types.

<dl></dl>

<dt>Enumerator:</dt>

<dd></dd>

(

p_equalizer,

unsigned 

u_band 

)

Get the amplification value for a particular equalizer frequency band.

<dt>Parameters</dt>

p_equalizer

valid equalizer handle, must not be NULL

u_band

index, counting from zero, of the frequency band to get

<dt>Returns</dt>

<dd>amplification value (Hz); NaN if there is no such frequency band</dd>

<dt>Version</dt>

<dd>LibVLC 2.2.0 or later</dd>

void 

Get the number of distinct frequency bands for an equalizer.

<dd>number of frequency bands</dd>

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.

index of the band, counting from zero

<dd>equalizer band frequency (Hz), or -1 if there is no such band</dd>

Get the current pre-amplification value from an equalizer.

<dd>preamp value (Hz)</dd>

Get the number of equalizer presets.

<dd>number of presets</dd>

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.

index of the preset, counting from zero

<dd>preset name, or NULL if there is no such preset</dd>

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

<dd>opaque equalizer handle, or NULL on error</dd>

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

Release a previously created equalizer instance.

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

opaque equalizer handle, or NULL

float 

f_amp,

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

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

f_amp

amplification value (-20.0 to 20.0 Hz)

index, counting from zero, of the frequency band to set

<dd>zero on success, -1 on error</dd>

f_preamp 

Set a new pre-amplification value for an equalizer.

f_preamp

preamp value (-20.0 to 20.0 Hz)

p_mi

Get current audio channel.

media player

<dd>the audio channel</dd>

<dt>See Also</dt>

Get current audio delay.

<dd>the audio delay (microseconds)</dd>

<dd>LibVLC 1.1.1 or later</dd>

Get current mute status.

<dd>the mute status (boolean) if defined, -1 if undefined/unapplicable</dd>

Get current audio track.

<dd>the audio track ID or -1 if no active input.</dd>

Get number of available audio tracks.

<dd>the number of available audio tracks (int), or -1 if unavailable</dd>

Get the description of available audio tracks.

<dd>list with description of available audio tracks, or NULL</dd>

Get current software audio volume.

<dd>the software volume in percents (0 = mute, 100 = nominal / 0dB)</dd>

,

const char * 

Backward compatibility stub.

<dd>always 0.</dd>

mp

Gets a list of potential audio output devices,.

<dt>Note</dt>

<dd>Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (NULL).</dd>

<dd>The list may not be exhaustive.</dd>

<dt>Warning</dt>

<dd>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.</dd>

<dd>LibVLC 2.2.0 or later.</dd>

int 

<dd>always NULL.</dd>

p_instance,

aout 

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

<dd>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.</dd>

<dd>The list might not be exhaustive.</dd>

p_instance

libvlc instance

psz_aout

<dd>LibVLC 2.1.0 or later.</dd>

p_list

Frees a list of available audio output devices.

list with audio outputs for release

mp,

module,

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.

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

<dd>The syntax for the device parameter depends on the audio output.</dd>

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

module

If NULL, current audio output module. if non-NULL, name of audio output module (

device_id

device identifier string

<dd>Nothing. Errors are ignored (this is a design bug).</dd>

Stub for backward compatibility.

<dd>always -1.</dd>

Gets the list of available audio output modules.

<dd>list of available audio outputs. It must be freed it with</dd>

Frees the list of available audio output modules.

p_mi,

psz_name 

Selects an audio output module.

<dd>Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing.</dd>

psz_name

name of audio output, use psz_name of

<dd>0 if function succeded, -1 on error</dd>

channel 

Set current audio channel.

channel

the audio channel,

<dd>0 on success, -1 on error</dd>

int64_t 

i_delay 

Set current audio delay.

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

i_delay

the audio delay (microseconds)

status 

Set mute status.

status

If status is true then mute, otherwise unmute

<dd>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.</dd>

<dd>To force silent playback, disable all audio tracks. This is more efficient and reliable than mute.</dd>

i_track 

Set current audio track.

i_track

the track ID (i_id field from track description)

i_volume 

Set current software audio volume.

i_volume

the volume in percents (0 = mute, 100 = 0dB)

<dd>0 if the volume was set, -1 if it was out of range</dd>

Toggle mute status.

p_equalizer 

Apply new equalizer settings to a media player.

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.

opaque media player handle

opaque equalizer handle, or NULL to disable the equalizer for this media player