Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of sleeping and then dropping the queue in `play_sound`, pass the queue back to the caller for safekeeping. Not pretty, but it makes the program work as expected. I think AudioQueue may just be broken. I would expect to be able to call `AudioQueue.queue_audio` repeatedly on the same object and have it play the sounds in sequence, or immediately, if no sound is currently playing. That's how it works on macOS. But on Linux (with PulseAudio), only the first `queue_audio` call plays anything, and subsequent calls are silent. Several variations of calls to `.pause`, `.resume`, and `.clear`, didn't improve matters. So the fix is to make a new queue for each sound and make sure it isn't dropped until that sound has finished playing.
- Loading branch information