Expand description
Audio service, widgets and other types.
§Service
The AUDIOS service manages audio loading and caching. Audio decoding is
implemented by the view-process, for this reason the service must be
used in a headed app or headless app with renderer, in a headless app without renderer no view-process
is spawned so no audio format will be available.
The audio service also define security limits, the AUDIOS.limits
variable to configure these limits. See AudioLimits::default for the defaults.
use zng::{audio, prelude::*};
audio::AUDIOS.limits().modify(|l| {
l.allow_uri = audio::UriFilter::allow_host("httpbin.org");
l.max_encoded_len = 1.megabytes();
l.max_decoded_len = 10.megabytes();
}); }The example above changes the global limits to allow audio downloads only from an specific host and only allow audio with sizes less or equal to 1 megabyte and that only expands to up to 10 megabytes after decoding.
§Full API
See zng_ext_audio for the full audio API.
Structs§
- AUDIOS
- Audio loading, cache and render service.
- Audio
Format - Represents an audio codec capability.
- Audio
Hash - A 256-bit hash for audio tracks.
- Audio
Limits - Limits for audio loading and decoding.
- Audio
Mix - Represents an audio source.
- Audio
Options - Options for
AUDIOS.audio. - Audio
Output - Represents an open audio output stream.
- Audio
Output Id - Unique identifier of an open audio output.
- Audio
Track - State of an
AudioVar.
Enums§
- Audio
Cache Mode - Cache mode of
AUDIOS. - Audio
Data Format - Format of the audio bytes.
- Audio
Output State - Represents the playback state if an audio output stream.
- Audio
Source - The different sources of an audio resource.
- Audio
Source Filter - Represents a
PathFilterandUriFilter.
Type Aliases§
- Audio
Var - Represents an
AudioTracktracked by theAUDIOScache. - UriFilter
- Represents an
AudioSource::Downloadpath request filter.