bevy
bevy copied to clipboard
Indicate steps in registering a new `bevy::audio::Decodable` type
How can Bevy's documentation be improved?
Documentation for creating a new Decodable type is non-existent.
Here are the steps in creating a new Decodable type:
- Create a type (we'll call it
CustomAudio) that can be registered as anAssetand asDecodable. - Create a
Decodable::Decoderiterator type that generate samples. This must beSend, as this type will be sent to the audio thread. This also must implementrodio::Source. - Register the
Decodabletype (CustomAudio) as an asset in the app. - Initialize the
Audio<CustomAudio>resource inApp. - Initialize the
AudioOutput<CustomAudio>non-send resource. - Add the
play_queued_audio_system::<CustomAudio>function to thePostUpdatestage.
Congratulations, you now have a working audio type that can be played by bevy!
working on this.