faiface / beep

A little package that brings sound to any Go application. Suitable for playback and audio-processing.
MIT License
2.08k stars 152 forks source link

Run beep/examples/playing didn't hear the beep #32

Closed ghost closed 5 years ago

ghost commented 6 years ago

platform:mac os x 10.12.6

if i put this in the end ,it works: time.Sleep(time.Millisecond*100)

it seems like if the sound was too short , like a beep,the seq streamer returned before the sound actually been played.

Did someone else have the same problem?

faiface commented 6 years ago

What's possibly happening is that because the size of the speaker buffer in the example is 1/10s, the audio is delayed roughly by 1/10s. Therefore, yeah, it may end up unplayed, which is fixed exactly by sleeping a bit.