SolarLiner / bevy-kira-components

Experimental Bevy <-> Kira integration crate
https://solarliner.dev/bevy-kira-components/bevy_kira_components/
MIT License
9 stars 6 forks source link

Add playback_rate to settings #22

Closed mgi388 closed 4 months ago

mgi388 commented 5 months ago

Fixes #20

Description

As with volume, only support fixed playback rates and so just expose it as an f64/Fixed.

Usage:

commands.spawn(
    AudioFileBundle {
        source,
        settings: AudioFileSettings {
            loop_region,
            volume,
            playback_rate: 0.25, // play at 25% of the usual speed
            ..default()
        },
        ..default()
    },
);

I decided not to update or add an example because the audio_control example already adjusts playback rate per frame and this new feature is just for setting an initial starting playback rate so it's not really that interesting.