Skip to content

Panicks on getting default speakers #55

@GabrielleShull

Description

@GabrielleShull

A compiled example panics when running let mut speakers = Speakers::default();

To reproduce the bug:

  1. Go to the wavy documentation page.
  2. Copy the dependencies to the Cargo.toml file
  3. Replace the contents of the main.rs file with the example code.
  4. Enter RUST_BACKTRACE=1 cargo run in the terminal.
  5. See the error in the backtrace:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/gabbie/.cargo/registry/src/github.com-1ecc6299db9ec823/wavy-0.8.1/src/ffi/linux/speakers.rs:87:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
   2: core::panicking::panic
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:48:5
   3: core::option::Option<T>::unwrap
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/option.rs:755:21
   4: <wavy::ffi::speakers::Speakers as core::default::Default>::default
             at /home/gabbie/.cargo/registry/src/github.com-1ecc6299db9ec823/wavy-0.8.1/src/ffi/linux/speakers.rs:86:13
   5: <wavy::speakers::Speakers as core::default::Default>::default
             at /home/gabbie/.cargo/registry/src/github.com-1ecc6299db9ec823/wavy-0.8.1/src/speakers.rs:66:21
   6: record_n_play::main
             at ./src/main.rs:32:24
   7: core::ops::function::FnOnce::call_once
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227:5

My expectation was that audio would be recorded and played back in real time.

Laptop information:

  • OS: NixOS 21.11.337975.eabc3821918 (Porcupine) with Linux kernel version 5.15.50
  • Model: HP Laptop 14-dk0028wm

I look forward to learning from this.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions