NiklasEi/bevy_kira_audio

bevy_kira doesn't build for wasm after cargo update

johanhelsing opened this issue · 3 comments

I guess this is probably an upstream bug, but I get compilation errors for wasm after I ran cargo update.

$ cargo check --target wasm32-unknown-unknown
<snip>
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> C:\Users\Johan\.cargo\registry\src\github.com-1ecc6299db9ec823\kira-0.7.2\src\manager\backend\cpal\wasm.rs:51:24
    |
51  |               let stream = device.build_output_stream(
    |  _________________________________^^^^^^^^^^^^^^^^^^^-
52  | |                 &config,
53  | |                 move |data: &mut [f32], _| {
54  | |                     renderer.on_start_processing();
...   |
65  | |                 move |_| {},
66  | |             )?;
    | |_____________- an argument of type `Option<Duration>` is missing
    |
note: associated function defined here
   --> C:\Users\Johan\.cargo\registry\src\github.com-1ecc6299db9ec823\cpal-0.15.1\src\traits.rs:153:8
    |
153 |     fn build_output_stream<T, D, E>(
    |        ^^^^^^^^^^^^^^^^^^^
help: provide the argument
    |
51  ~             let stream = device.build_output_stream(&config, move |data: &mut [f32], _| {
52  ~                     renderer.on_start_processing();
53  ~                     for frame in data.chunks_exact_mut(channels as usize) {
54  ~                         let out = renderer.process();
55  ~                         if channels == 1 {
56  ~                             frame[0] = (out.left + out.right) / 2.0;
57  ~                         } else {
58  ~                             frame[0] = out.left;
59  ~                             frame[1] = out.right;
60  ~                         }
61  ~                     }
62  ~                 }, move |_| {}, /* Option<Duration> */)?;
    |

Just adding it here in case you might want to track it.

Yep, compiles again after doing:

cargo update -p kira --precise 0.7.1

Maybe we should pin the dependency?

Created an issue on the kira repo: tesselode/kira#47

Is this issue resolved for you with the new kia version?

Yep, builds for wasm again with kira 0.7.3 :)