From 3b9e6c27087aa088a7b14aa279bfab59b18989c8 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 4 Jun 2017 21:09:42 +0900 Subject: [PATCH] audio: Use the new oto API --- audio/audio.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/audio.go b/audio/audio.go index 84fa64466..07ef2ebad 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -220,8 +220,9 @@ func (c *Context) Update() error { // is unexpectable. // e.g. a variable for JVM on Android might not be set. if c.driver == nil { - // TODO: Rename this other than player - p, err := oto.NewPlayer(c.sampleRate, channelNum, bytesPerSample) + // The buffer size is 1/20 sec. + s := c.sampleRate * channelNum * bytesPerSample / 20 + p, err := oto.NewPlayer(c.sampleRate, channelNum, bytesPerSample, s) c.driver = p if err != nil { return err