pub struct CaptureProxy { /* private fields */ }
Implementations§
Source§impl CaptureProxy
impl CaptureProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.test.audio/Capture.
Sourcepub fn take_event_stream(&self) -> CaptureEventStream
pub fn take_event_stream(&self) -> CaptureEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn start_output_capture(
&self,
) -> QueryResponseFut<CaptureStartOutputCaptureResult, DefaultFuchsiaResourceDialect>
pub fn start_output_capture( &self, ) -> QueryResponseFut<CaptureStartOutputCaptureResult, DefaultFuchsiaResourceDialect>
Start capturing the outgoing audio for this device.
A virtual output device receives what would have played through the device’s speakers. This method reads from that virtual output device, into an internal buffer.
After calling this method, use StopOutputCapture
to stop recording output and
then GetOutputAudio
to retrieve this captured audio.
- response
error
description of failure action to take.
Sourcepub fn stop_output_capture(
&self,
) -> QueryResponseFut<CaptureStopOutputCaptureResult, DefaultFuchsiaResourceDialect>
pub fn stop_output_capture( &self, ) -> QueryResponseFut<CaptureStopOutputCaptureResult, DefaultFuchsiaResourceDialect>
Stop capturing the outgoing audio for this device.
This method will succeed even if no output capture has been started.
After calling this method, use GetOutputAudio
to retrieve the captured
audio from the virtual device’s internal buffer and return it to the client.
- response
error
description of failure action to take.
Sourcepub fn get_output_audio(
&self,
) -> QueryResponseFut<CaptureGetOutputAudioResult, DefaultFuchsiaResourceDialect>
pub fn get_output_audio( &self, ) -> QueryResponseFut<CaptureGetOutputAudioResult, DefaultFuchsiaResourceDialect>
Extract the captured outgoing audio data through a socket.
The socket is closed once it is fully drained.
User should have first called StartOutputCapture
and StopOutputCapture
. This method will
return the contents of the internal buffer that was populated between the calls to those
two methods.
Audio output format is 2-channel 48kHz 16-bit PCM.
- request
audio_reader
socket where full captured audio data will be streamed.
- response
error
description of failure action to take.
Trait Implementations§
Source§impl CaptureProxyInterface for CaptureProxy
impl CaptureProxyInterface for CaptureProxy
type StartOutputCaptureResponseFut = QueryResponseFut<Result<(), AudioTestError>>
type StopOutputCaptureResponseFut = QueryResponseFut<Result<(), AudioTestError>>
type GetOutputAudioResponseFut = QueryResponseFut<Result<Socket, AudioTestError>>
fn start_output_capture(&self) -> Self::StartOutputCaptureResponseFut
fn stop_output_capture(&self) -> Self::StopOutputCaptureResponseFut
fn get_output_audio(&self) -> Self::GetOutputAudioResponseFut
Source§impl Clone for CaptureProxy
impl Clone for CaptureProxy
Source§fn clone(&self) -> CaptureProxy
fn clone(&self) -> CaptureProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CaptureProxy
impl Debug for CaptureProxy
Source§impl Proxy for CaptureProxy
impl Proxy for CaptureProxy
Source§type Protocol = CaptureMarker
type Protocol = CaptureMarker
Proxy
controls.