Audio / DecodableBack to examples View in GitHub
Support WarningWebGPU 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.
Support for WebGPU in Bevy hasn't been released yet, this example has been compiled using the main branch.
//! Shows how to create a custom [`Decodable`] type by implementing a Sine wave. use AddAudioSource; use AudioPlugin; use Source; use *; use TypeUuid; 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. // Implementing `TypeUuid` will automatically implement `Asset`. // 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`.