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 an Asset and as Decodable.
- Create a
Decodable::Decoder iterator type that generate samples. This must be Send, as this type will be sent to the audio thread. This also must implement rodio::Source.
- Register the
Decodable type (CustomAudio) as an asset in the app.
- Initialize the
Audio<CustomAudio> resource in App.
- Initialize the
AudioOutput<CustomAudio> non-send resource.
- Add the
play_queued_audio_system::<CustomAudio> function to the PostUpdate stage.
Congratulations, you now have a working audio type that can be played by bevy!
How can Bevy's documentation be improved?
Documentation for creating a new
Decodabletype is non-existent.Here are the steps in creating a new
Decodabletype:CustomAudio) that can be registered as anAssetand asDecodable.Decodable::Decoderiterator type that generate samples. This must beSend, as this type will be sent to the audio thread. This also must implementrodio::Source.Decodabletype (CustomAudio) as an asset in the app.Audio<CustomAudio>resource inApp.AudioOutput<CustomAudio>non-send resource.play_queued_audio_system::<CustomAudio>function to thePostUpdatestage.Congratulations, you now have a working audio type that can be played by bevy!