原文 http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html
Typedefs |
|
typedef enum libvlc_audio_output_device_types_t |
libvlc_audio_output_device_types_t |
Audio device types. | |
typedef enum libvlc_audio_output_channel_t |
libvlc_audio_output_channel_t |
Audio channels. |
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... |
Functions |
|
LIBVLC_API libvlc_audio_output_t * | libvlc_audio_output_list_get (libvlc_instance_t *p_instance) |
Gets the list of available audio output modules. | |
LIBVLC_API void | libvlc_audio_output_list_release (libvlc_audio_output_t *p_list) |
Frees the list of available audio output modules. | |
LIBVLC_API int | libvlc_audio_output_set (libvlc_media_player_t *p_mi, const char *psz_name) |
Selects an audio output module. | |
LIBVLC_DEPRECATED LIBVLC_API int | libvlc_audio_output_device_count (libvlc_instance_t *, const char *) |
Backward compatibility stub. | |
LIBVLC_DEPRECATED LIBVLC_API char * | libvlc_audio_output_device_longname (libvlc_instance_t *, const char *, int) |
Backward compatibility stub. | |
LIBVLC_DEPRECATED LIBVLC_API char * | libvlc_audio_output_device_id (libvlc_instance_t *, const char *, int) |
Backward compatibility stub. | |
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,. | |
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,. | |
LIBVLC_API void | libvlc_audio_output_device_list_release (libvlc_audio_output_device_t *p_list) |
Frees a list of available audio output devices. | |
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. | |
LIBVLC_DEPRECATED LIBVLC_API int | libvlc_audio_output_get_device_type (libvlc_media_player_t *p_mi) |
Stub for backward compatibility. | |
LIBVLC_DEPRECATED LIBVLC_API void | libvlc_audio_output_set_device_type (libvlc_media_player_t *, int) |
Stub for backward compatibility. | |
LIBVLC_API void | libvlc_audio_toggle_mute (libvlc_media_player_t *p_mi) |
Toggle mute status. | |
LIBVLC_API int | libvlc_audio_get_mute (libvlc_media_player_t *p_mi) |
Get current mute status. | |
LIBVLC_API void | libvlc_audio_set_mute (libvlc_media_player_t *p_mi, int status) |
Set mute status. | |
LIBVLC_API int | libvlc_audio_get_volume (libvlc_media_player_t *p_mi) |
Get current software audio volume. | |
LIBVLC_API int | libvlc_audio_set_volume (libvlc_media_player_t *p_mi, int i_volume) |
Set current software audio volume. | |
LIBVLC_API int | libvlc_audio_get_track_count (libvlc_media_player_t *p_mi) |
Get number of available audio tracks. | |
LIBVLC_API libvlc_track_description_t * |
libvlc_audio_get_track_description (libvlc_media_player_t *p_mi) |
Get the description of available audio tracks. | |
LIBVLC_API int | libvlc_audio_get_track (libvlc_media_player_t *p_mi) |
Get current audio track. | |
LIBVLC_API int | libvlc_audio_set_track (libvlc_media_player_t *p_mi, int i_track) |
Set current audio track. | |
LIBVLC_API int | libvlc_audio_get_channel (libvlc_media_player_t *p_mi) |
Get current audio channel. | |
LIBVLC_API int | libvlc_audio_set_channel (libvlc_media_player_t *p_mi, int channel) |
Set current audio channel. | |
LIBVLC_API int64_t | libvlc_audio_get_delay (libvlc_media_player_t *p_mi) |
Get current audio delay. | |
LIBVLC_API int | libvlc_audio_set_delay (libvlc_media_player_t *p_mi, int64_t i_delay) |
Set current audio delay. | |
LIBVLC_API unsigned | libvlc_audio_equalizer_get_preset_count (void) |
Get the number of equalizer presets. | |
LIBVLC_API const char * | libvlc_audio_equalizer_get_preset_name (unsigned u_index) |
Get the name of a particular equalizer preset. | |
LIBVLC_API unsigned | libvlc_audio_equalizer_get_band_count (void) |
Get the number of distinct frequency bands for an equalizer. | |
LIBVLC_API float | libvlc_audio_equalizer_get_band_frequency (unsigned u_index) |
Get a particular equalizer band frequency. | |
LIBVLC_API libvlc_equalizer_t * | libvlc_audio_equalizer_new (void) |
Create a new default equalizer, with all frequency values zeroed. | |
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. | |
LIBVLC_API void | libvlc_audio_equalizer_release (libvlc_equalizer_t *p_equalizer) |
Release a previously created equalizer instance. | |
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. | |
LIBVLC_API float | libvlc_audio_equalizer_get_preamp (libvlc_equalizer_t *p_equalizer) |
Get the current pre-amplification value from an equalizer. | |
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. | |
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. | |
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. |
Audio channels.
Audio device types.
Audio device types.
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.
p_equalizer | valid equalizer handle, must not be NULL |
u_band | index, counting from zero, of the frequency band to get |
LIBVLC_API unsigned libvlc_audio_equalizer_get_band_count | ( | void | ) |
Get the number of distinct frequency bands for an equalizer.
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.
u_index | index of the band, counting from zero |
LIBVLC_API float libvlc_audio_equalizer_get_preamp | ( | libvlc_equalizer_t * | p_equalizer | ) |
Get the current pre-amplification value from an equalizer.
p_equalizer | valid equalizer handle, must not be NULL |
LIBVLC_API unsigned libvlc_audio_equalizer_get_preset_count | ( | void | ) |
Get the number of equalizer presets.
LIBVLC_API const 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.
u_index | index of the preset, counting from zero |
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.
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.
u_index | index of the preset, counting from zero |
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.
p_equalizer | opaque equalizer handle, or NULL |
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.
p_equalizer | valid equalizer handle, must not be NULL |
f_amp | amplification value (-20.0 to 20.0 Hz) |
u_band | index, counting from zero, of the frequency band to set |
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.
p_equalizer | valid equalizer handle, must not be NULL |
f_preamp | preamp value (-20.0 to 20.0 Hz) |
LIBVLC_API int libvlc_audio_get_channel | ( | libvlc_media_player_t * | p_mi | ) |
Get current audio channel.
p_mi | media player |
LIBVLC_API int64_t libvlc_audio_get_delay | ( | libvlc_media_player_t * | p_mi | ) |
Get current audio delay.
p_mi | media player |
LIBVLC_API int libvlc_audio_get_mute | ( | libvlc_media_player_t * | p_mi | ) |
Get current mute status.
p_mi | media player |
LIBVLC_API int libvlc_audio_get_track | ( | libvlc_media_player_t * | p_mi | ) |
Get current audio track.
p_mi | media player |
LIBVLC_API int libvlc_audio_get_track_count | ( | libvlc_media_player_t * | p_mi | ) |
Get number of available audio tracks.
p_mi | media player |
LIBVLC_API libvlc_track_description_t* libvlc_audio_get_track_description | ( | libvlc_media_player_t * | p_mi | ) |
Get the description of available audio tracks.
p_mi | media player |
LIBVLC_API int libvlc_audio_get_volume | ( | libvlc_media_player_t * | p_mi | ) |
Get current software audio volume.
p_mi | media player |
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.
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,.
mp | media player |
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.
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,.
p_instance | libvlc instance |
psz_aout | audio output name (as returned by libvlc_audio_output_list_get()) |
LIBVLC_API void libvlc_audio_output_device_list_release | ( | libvlc_audio_output_device_t * | p_list | ) |
Frees a list of available audio output devices.
p_list | list with audio outputs for release |
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.
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().
Some audio output modules require further parameters (e.g. a channels map in the case of ALSA).
mp | media player |
module | If NULL, current audio output module. if non-NULL, name of audio output module ( |
device_id | device identifier string |
LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_output_get_device_type | ( | libvlc_media_player_t * | p_mi | ) |
Stub for backward compatibility.
LIBVLC_API libvlc_audio_output_t* libvlc_audio_output_list_get | ( | libvlc_instance_t * | p_instance | ) |
Gets the list of available audio output modules.
p_instance | libvlc instance |
LIBVLC_API void libvlc_audio_output_list_release | ( | libvlc_audio_output_t * | p_list | ) |
Frees the list of available audio output modules.
p_list | list with audio outputs for release |
LIBVLC_API int libvlc_audio_output_set | ( | libvlc_media_player_t * | p_mi, |
const char * | psz_name | ||
) |
Selects an audio output module.
p_mi | media player |
psz_name | name of audio output, use psz_name of |
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.
p_mi | media player |
channel | the audio channel, |
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.
p_mi | media player |
i_delay | the audio delay (microseconds) |
LIBVLC_API void libvlc_audio_set_mute | ( | libvlc_media_player_t * | p_mi, |
int | status | ||
) |
Set mute status.
p_mi | media player |
status | If status is true then mute, otherwise unmute |
LIBVLC_API int libvlc_audio_set_track | ( | libvlc_media_player_t * | p_mi, |
int | i_track | ||
) |
Set current audio track.
p_mi | media player |
i_track | the track ID (i_id field from track description) |
LIBVLC_API int libvlc_audio_set_volume | ( | libvlc_media_player_t * | p_mi, |
int | i_volume | ||
) |
Set current software audio volume.
p_mi | media player |
i_volume | the volume in percents (0 = mute, 100 = 0dB) |
LIBVLC_API void libvlc_audio_toggle_mute | ( | libvlc_media_player_t * | p_mi | ) |
Toggle mute status.
p_mi | media player |
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.
p_mi | opaque media player handle |
p_equalizer | opaque equalizer handle, or NULL to disable the equalizer for this media player |