-
Notifications
You must be signed in to change notification settings - Fork 133
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
question about example #240
Comments
Does the current example cause crash? Then, could you file an issue and send a PR? Thanks, |
Or, if the crash happens in your app, I need to see your code... |
Well, I didn't manage to reproduce this crash with an example yet, maybe it is related to my my code is here: https://github.com/gucio321/morse/blob/master/pkg/generator/sine_wave.go |
you can run this: and after some time you should get panic: runtime error: slice bounds out of range [:-17280]
goroutine 6 [running]:
github.com/gucio32/morse/pkg/generator.(*SineWave).Read(0xc000096af0, {0xc0000b0000?, 0x482fa9?, 0x0?})
/home/me/git/morse/pkg/generator/sine_wave.go:54 +0x4f7
github.com/ebitengine/oto/v3/internal/mux.(*playerImpl).read(0xc0000bc000?, {0xc0000b0000?, 0xc000096b50?, 0x481200?})
/home/me/go/pkg/mod/github.com/ebitengine/oto/v3@v3.2.0/internal/mux/mux.go:268 +0xc8
github.com/ebitengine/oto/v3/internal/mux.(*playerImpl).readSourceToBuffer(0xc0000aa1b0)
/home/me/go/pkg/mod/github.com/ebitengine/oto/v3@v3.2.0/internal/mux/mux.go:529 +0x145
github.com/ebitengine/oto/v3/internal/mux.(*Mux).loop(0xc00008a0c0)
/home/me/go/pkg/mod/github.com/ebitengine/oto/v3@v3.2.0/internal/mux/mux.go:108 +0x205
created by github.com/ebitengine/oto/v3/internal/mux.New in goroutine 1
/home/me/go/pkg/mod/github.com/ebitengine/oto/v3@v3.2.0/internal/mux/mux.go:69 +0xf8
exit status 2 |
Oto implementation also uses mutex so Seek should be thread safe. I'll take a look later, but I hope you could create a more minimal case to reproduce the issue. Thanks, |
You should return an error when |
I found an interessting thing: if you modify an example like this: gucio321@d969893 not every sound is played |
OK, please report issues one by one with a minimized test case to reproduce it. Thanks, |
Hi there!
context
I'm working on a morse code generator app. I've based my code on oto's example (sine wave is exactly what I needed).
My issue
After implementing the code in my app I noticed 2 issues:
(*SinWave).Read
sometimes panics withindex out of range [:-3XXXX]
or, sometimes sound was corrupted (longer and glitchy). I managed to fix that by addingsync.Mutex
(For some reason Read was called twice by oto, idk why).stuckReduction
is a constant, which for me is300
but could be reducd probably to about 100/200.Let me know if my notes are worth adding to the example 😄.
The text was updated successfully, but these errors were encountered: