this post was submitted on 03 Sep 2023
17 points (100.0% liked)
Rust Programming
8134 readers
4 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You say you've tried longer durations, but you're only sleeping for microseconds here... I'd assume you're simply playing the sound 30 times in 30 microseconds and as such only hear the last iteration. If you want the whole file to play every time, you could replace
play_raw
withplay_once
and use the returned Sink to simplysleep_until_end()
instead of your own delay