pub enum AudioCoreRequest {
CreateAudioRenderer {
audio_out_request: ServerEnd<AudioRendererMarker>,
control_handle: AudioCoreControlHandle,
},
CreateAudioCapturerWithConfiguration {
stream_type: AudioStreamType,
configuration: AudioCapturerConfiguration,
audio_capturer_request: ServerEnd<AudioCapturerMarker>,
control_handle: AudioCoreControlHandle,
},
CreateAudioCapturer {
loopback: bool,
audio_in_request: ServerEnd<AudioCapturerMarker>,
control_handle: AudioCoreControlHandle,
},
EnableDeviceSettings {
enabled: bool,
control_handle: AudioCoreControlHandle,
},
SetRenderUsageGain {
usage: AudioRenderUsage,
gain_db: f32,
control_handle: AudioCoreControlHandle,
},
SetCaptureUsageGain {
usage: AudioCaptureUsage,
gain_db: f32,
control_handle: AudioCoreControlHandle,
},
BindUsageVolumeControl {
usage: Usage,
volume_control: ServerEnd<VolumeControlMarker>,
control_handle: AudioCoreControlHandle,
},
GetVolumeFromDb {
usage: Usage,
gain_db: f32,
responder: AudioCoreGetVolumeFromDbResponder,
},
GetDbFromVolume {
usage: Usage,
volume: f32,
responder: AudioCoreGetDbFromVolumeResponder,
},
SetInteraction {
active: Usage,
affected: Usage,
behavior: Behavior,
control_handle: AudioCoreControlHandle,
},
ResetInteractions {
control_handle: AudioCoreControlHandle,
},
LoadDefaults {
control_handle: AudioCoreControlHandle,
},
}
Variants§
CreateAudioRenderer
Creates an AudioRenderer which outputs audio to the default device.
CreateAudioCapturerWithConfiguration
Creates an AudioCapturer according to the given requirements.
pcm_stream_type
sets the stream type of the stream to be delivered.
It causes the source material to be reformatted/resampled if needed
in order to produce the requested stream type.
usage
is used by Fuchsia to make decisions about user experience.
See AudioCaptureUsage
for more details.
configuration
must be initialized to a variant, or no capturer
can be created.
Fields
stream_type: AudioStreamType
configuration: AudioCapturerConfiguration
audio_capturer_request: ServerEnd<AudioCapturerMarker>
control_handle: AudioCoreControlHandle
CreateAudioCapturer
Creates an AudioCapturer which either captures from the current default audio input device, or loops-back from the current default audio output device based on value passed for the loopback flag.
EnableDeviceSettings
SetRenderUsageGain
Sets the Usage gain applied to Renderers. By default, the gain for all render usages is set to Unity (0 db).
SetCaptureUsageGain
Sets the Usage gain applied to Capturers. By default, the gain for all capture usages is set to Unity (0 db).
BindUsageVolumeControl
Binds to a volume control protocol for the given usage.
GetVolumeFromDb
Queries the volume percentage [0, 1] that maps to a gain_db
value for a particular
usage
. This is the same mapping as used by the VolumeControl from
BindUsageVolumeControl
.
GetDbFromVolume
Queries the decibel value that maps to a volume percentage [0, 1] for a particular usage
.
This is the same mapping as used by the VolumeControl from BindUsageVolumeControl
.
SetInteraction
Sets how audio_core handles interactions of multiple active streams simultaneously. If
streams of Usage active
are processing audio, and streams of Usage affected
are as well,
the Behavior specified will be applied to the streams of Usage affected
.
ResetInteractions
Re-initializes the set of rules that are currently governing the interaction of streams in audio_core. The default behavior is ‘NONE’.
Fields
control_handle: AudioCoreControlHandle
LoadDefaults
Re-loads the platform policy configuration. Falls back to a default config if the platform does not provide a config.
Fields
control_handle: AudioCoreControlHandle
Implementations§
source§impl AudioCoreRequest
impl AudioCoreRequest
pub fn into_create_audio_renderer( self, ) -> Option<(ServerEnd<AudioRendererMarker>, AudioCoreControlHandle)>
pub fn into_create_audio_capturer_with_configuration( self, ) -> Option<(AudioStreamType, AudioCapturerConfiguration, ServerEnd<AudioCapturerMarker>, AudioCoreControlHandle)>
pub fn into_create_audio_capturer( self, ) -> Option<(bool, ServerEnd<AudioCapturerMarker>, AudioCoreControlHandle)>
pub fn into_enable_device_settings( self, ) -> Option<(bool, AudioCoreControlHandle)>
pub fn into_set_render_usage_gain( self, ) -> Option<(AudioRenderUsage, f32, AudioCoreControlHandle)>
pub fn into_set_capture_usage_gain( self, ) -> Option<(AudioCaptureUsage, f32, AudioCoreControlHandle)>
pub fn into_bind_usage_volume_control( self, ) -> Option<(Usage, ServerEnd<VolumeControlMarker>, AudioCoreControlHandle)>
pub fn into_get_volume_from_db( self, ) -> Option<(Usage, f32, AudioCoreGetVolumeFromDbResponder)>
pub fn into_get_db_from_volume( self, ) -> Option<(Usage, f32, AudioCoreGetDbFromVolumeResponder)>
pub fn into_set_interaction( self, ) -> Option<(Usage, Usage, Behavior, AudioCoreControlHandle)>
pub fn into_reset_interactions(self) -> Option<AudioCoreControlHandle>
pub fn into_load_defaults(self) -> Option<AudioCoreControlHandle>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL