Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playback_rate to settings #22

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Conversation

mgi388
Copy link
Contributor

@mgi388 mgi388 commented Jun 16, 2024

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.

Copy link
Owner

@SolarLiner SolarLiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SolarLiner SolarLiner merged commit a9bbbd1 into SolarLiner:main Jun 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Expose playback_rate to AudioFileSettings
2 participants