Struct amethyst::audio::AudioContext
[−]
[src]
pub struct AudioContext { /* fields omitted */ }
A context for loading audio files
Methods
impl AudioContext
[src]
fn new() -> AudioContext
[src]
Creates a new audio context.
Trait Implementations
impl Context for AudioContext
[src]
type Asset = Source
The asset type this context can produce.
type Data = Vec<u8>
The Data
type the asset can be created from.
type Error = NoError
The error that may be returned from create_asset
.
type Result = Result<Self::Asset, Self::Error>
The result type for loading an asset. This can also be a future (or anything that implements IntoFuture
). Read more
fn category(&self) -> &str
[src]
A small keyword for which category these assets belongs to. Read more
fn create_asset(&self, data: Vec<u8>, _: &ThreadPool) -> Result<Source, NoError>
[src]
Provides the conversion from the data format to the actual asset.
fn update(&self, spec: &AssetSpec, asset: AssetFuture<Source>)
[src]
Updates an asset after it's been reloaded. Read more
fn cache(&self, _spec: AssetSpec, _asset: AssetFuture<Self::Asset>)
[src]
Notifies about an asset load. This is can be used to cache the asset. To return a cached asset, see the retrieve
function. Read more
fn retrieve(&self, _spec: &AssetSpec) -> Option<AssetFuture<Self::Asset>>
[src]
Returns Some
cached value if possible, otherwise None
. Read more
fn clear(&self)
[src]
Gives a hint that several assets may have been released recently. Read more
fn clear_all(&self)
[src]
Request for clearing the whole cache.