pub struct PlatformAudioSink { /* private fields */ }Expand description
SoundManager を engine の AudioSink インターフェースへ適合させる。
engine 側の <audio> ウィジェットはこの型を知る必要がなく、
cpal の出力デバイスも engine には露出しなくなる。
Implementations§
Trait Implementations§
Source§impl AudioSink for PlatformAudioSink
impl AudioSink for PlatformAudioSink
Source§fn preload(&self, data: &[u8]) -> Result<(), AudioError>
fn preload(&self, data: &[u8]) -> Result<(), AudioError>
Decodes
data and rewinds to the start, without starting playback.Source§fn play(&self, source: &str, data: Option<&[u8]>) -> Result<(), AudioError>
fn play(&self, source: &str, data: Option<&[u8]>) -> Result<(), AudioError>
Starts playback of
source, restarting from the beginning if the
source is not currently playing. Read moreSource§fn current_seconds(&self) -> f32
fn current_seconds(&self) -> f32
The current playback position, in seconds.
Source§fn duration_seconds(&self) -> f32
fn duration_seconds(&self) -> f32
The decoded duration in seconds, or
0.0 when nothing is loaded.Source§fn is_finished(&self) -> bool
fn is_finished(&self) -> bool
Whether the decoded source reached its end.
Auto Trait Implementations§
impl !Freeze for PlatformAudioSink
impl RefUnwindSafe for PlatformAudioSink
impl Send for PlatformAudioSink
impl Sync for PlatformAudioSink
impl Unpin for PlatformAudioSink
impl UnsafeUnpin for PlatformAudioSink
impl UnwindSafe for PlatformAudioSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().