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

0.10 -> 0.11 Error in migration guide for bevy_audio #695

Closed
Gnamra opened this issue Jul 9, 2023 · 2 comments
Closed

0.10 -> 0.11 Error in migration guide for bevy_audio #695

Gnamra opened this issue Jul 9, 2023 · 2 comments

Comments

@Gnamra
Copy link

Gnamra commented Jul 9, 2023

In the migration guide, the following example code is given:

fn play_music(
    mut commands: Commands,
    asset_server: Res<AssetServer>,
) {
    commands.spawn((
        AudioBundle::from_audio_source(asset_server.load("music.ogg"))
            .with_settings(PlaybackSettings::LOOP.with_volume(0.5)),
        MyMusic,
    ));
}

however, when I try to do this I get two errors:

  • AudioBundle::from_audio_source
    no function or associated item named from_audio_source found for struct AudioSourceBundle in the current scope
    function or associated item not found in AudioSourceBundle

  • PlaybackSettings::LOOP.with_volume(0.5)
    mismatched types, expected Volume, found floating-point number

@Gnamra Gnamra changed the title Error in migration guide for bevy_audio Migration 0.10 -> 0.11: Error in migration guide for bevy_audio Jul 10, 2023
@Gnamra Gnamra changed the title Migration 0.10 -> 0.11: Error in migration guide for bevy_audio 0.10 -> 0.11 Error in migration guide for bevy_audio Jul 10, 2023
@IDEDARY
Copy link
Contributor

IDEDARY commented Jul 10, 2023

Yeah, I got the same error. So I went digging and got it working. Here is PR for updated migration guide. It solves this issue.

@IDEDARY
Copy link
Contributor

IDEDARY commented Jul 11, 2023

The PR is merged, this can be closed.

@cart cart closed this as completed Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants