pub struct SoundManager { /* private fields */ }Expand description
音声の管理を行う構造体
Implementations§
Source§impl SoundManager
impl SoundManager
Sourcepub fn load_from_bytes(&mut self, data: &[u8]) -> Result<()>
pub fn load_from_bytes(&mut self, data: &[u8]) -> Result<()>
Decodes audio bytes and resets playback to the beginning.
Sourcepub fn play_from_bytes(&mut self, data: &[u8]) -> Result<()>
pub fn play_from_bytes(&mut self, data: &[u8]) -> Result<()>
バイト列から音声を再生する
Sourcepub fn play_from_file(&mut self, path: &str) -> Result<()>
pub fn play_from_file(&mut self, path: &str) -> Result<()>
ローカルファイルから音声を再生する
Sourcepub fn play_from_local_uri(&mut self, uri: &str) -> Result<()>
pub fn play_from_local_uri(&mut self, uri: &str) -> Result<()>
URIから音声を再生する(resourceまたはfileスキームに対応)
通常の再生には play_from_bytes を使用してください。
これはテスト用メソッドです
Sourcepub fn current_seconds(&self) -> f32
pub fn current_seconds(&self) -> f32
Returns the current playback position in seconds.
Sourcepub fn duration_seconds(&self) -> f32
pub fn duration_seconds(&self) -> f32
Returns the decoded audio duration in seconds.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns whether the decoded audio reached its end.
Auto Trait Implementations§
impl !RefUnwindSafe for SoundManager
impl !UnwindSafe for SoundManager
impl Freeze for SoundManager
impl Send for SoundManager
impl Sync for SoundManager
impl Unpin for SoundManager
impl UnsafeUnpin for SoundManager
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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