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

play does not play with correct speed #4

Open
madskjeldgaard opened this issue Apr 12, 2024 · 5 comments
Open

play does not play with correct speed #4

madskjeldgaard opened this issue Apr 12, 2024 · 5 comments

Comments

@madskjeldgaard
Copy link

Hi !

Really cool tool!!

Just tried it and record worked flawlessly for me, but play seems to play back the file at the wrong speed. The same file played with sox plays normally through once at normal speed but then in asak it is played twice at double speed it seems. Probably not adjusting for sample rate.

@chaosprint
Copy link
Owner

thanks! it should be fixed now. try to reinstall it and run again.

@madskjeldgaard
Copy link
Author

Yes that fixes it!

Now there's just a panic at the end of the file. It doesn't affect playback but maybe important:

██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████thread '<unnamed>' panicked at /Users/mads/.cargo/registry/src/index.crates.io-6f17d22bba15001f/asak-0.1.3/src/playback.rs:169:60:
                                                                                                                               index out of bounds: the len is 108543 but the index is 108543
                                                        stack backtrace:
                                                                           0: _rust_begin_unwind
                                                                                                   1: core::panicking::panic_fmt
                                                                                                                                   2: core::panicking::panic_bounds_check
                                       3: coreaudio::audio_unit::render_callback::<impl coreaudio::audio_unit::AudioUnit>::set_render_callback::{{closure}}
                         4: _DefaultOutputAUFactory
                                                      5: _AUNotQuiteSoSimpleTimeFactory
                                                                                          6: _AUGenericOutputFactory
                                                                                                                       7: <unknown>
⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⠔⠢⡀⡠⡀⢀⣠   ⡠⢄⣀⡀⡠⢄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀   8: <unknown>                                 ⠈ ⠑⠁ ⢇⡔⠊   ⠈                                                                        ⠈⠁
                9: <unknown>                       ⠈
                              10: __pthread_joiner_wake
                                                       note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
         fatal runtime error: Rust panics must be rethrown
                                                          zsh: abort      asak play 20240413-165115.wav
                                                                                                       %

@chaosprint
Copy link
Owner

Yes that fixes it!

Now there's just a panic at the end of the file. It doesn't affect playback but maybe important:

██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████thread '<unnamed>' panicked at /Users/mads/.cargo/registry/src/index.crates.io-6f17d22bba15001f/asak-0.1.3/src/playback.rs:169:60:
                                                                                                                               index out of bounds: the len is 108543 but the index is 108543
                                                        stack backtrace:
                                                                           0: _rust_begin_unwind
                                                                                                   1: core::panicking::panic_fmt
                                                                                                                                   2: core::panicking::panic_bounds_check
                                       3: coreaudio::audio_unit::render_callback::<impl coreaudio::audio_unit::AudioUnit>::set_render_callback::{{closure}}
                         4: _DefaultOutputAUFactory
                                                      5: _AUNotQuiteSoSimpleTimeFactory
                                                                                          6: _AUGenericOutputFactory
                                                                                                                       7: <unknown>
⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⠔⠢⡀⡠⡀⢀⣠   ⡠⢄⣀⡀⡠⢄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀   8: <unknown>                                 ⠈ ⠑⠁ ⢇⡔⠊   ⠈                                                                        ⠈⠁
                9: <unknown>                       ⠈
                              10: __pthread_joiner_wake
                                                       note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
         fatal runtime error: Rust panics must be rethrown
                                                          zsh: abort      asak play 20240413-165115.wav
                                                                                                       %

just added a boundary check. does it work for you now?

@madskjeldgaard
Copy link
Author

No more panics here (but now the waveform doesn't move in playback mode for some reason). Sorry!

@chaosprint
Copy link
Owner

No more panics here (but now the waveform doesn't move in playback mode for some reason). Sorry!

it should be fine now; I forgot to change the pointer from the origin file length to the resampled length 😅

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

2 participants