Closed PaulDotSH closed 2 years ago
If I play an mp3 file at a specific time two times, even with a mutex, the software panics
func() { fmt.Println("a") SpeakerMutex.Lock() fmt.Println("...") f, _ := os.Open("./test/tmp.mp3") streamer, format, err := mp3.Decode(f) if err != nil { log.Fatal(err) } defer streamer.Close() speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10)) done := make(chan bool) speaker.Play(beep.Seq(streamer, beep.Callback(func() { done <- true }))) <-done SpeakerMutex.Unlock() }
there are 2 functions, this and another one exactly like this but which prints a "b", when they trigger at the same time, one plays the sound and the other one panics exactly after the mutex unlocks
If I play an mp3 file at a specific time two times, even with a mutex, the software panics
there are 2 functions, this and another one exactly like this but which prints a "b", when they trigger at the same time, one plays the sound and the other one panics exactly after the mutex unlocks