Support Warning
WebGPU is currently only supported on Chrome starting with version 113, and only on desktop. If they don't work on your configuration, you can check the WebGL2 examples here.decodable.rs:
//! Shows how to create a custom [`Decodable`] type by implementing a Sine wave.
use AddAudioSource;
use AudioPlugin;
use Source;
use *;
use TypePath;
use Duration;
// This struct usually contains the data for the audio being played.
// This is where data read from an audio file would be stored, for example.
// This allows the type to be registered as an asset.
// This decoder is responsible for playing the audio,
// and so stores data about the audio being played.
// The decoder must implement iterator so that it can implement `Decodable`.
// `Source` is what allows the audio source to be played by bevy.
// This trait provides information on the audio.
// Finally `Decodable` can be implemented for our `SineAudio`.