From 827f1234b21d05b412b6191f25a33712155709f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <30413512+eclipseo@users.noreply.github.com> Date: Fri, 7 Aug 2020 23:34:42 +0200 Subject: [PATCH] asset/player.go: Replace NewPlayer with NewContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NewPlayer has been deleted in github.com/hajimehoshi/oto 0.6.0 and after. Signed-off-by: Robert-André Mauchin --- asset/player.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asset/player.go b/asset/player.go index 3814e40..09a4495 100644 --- a/asset/player.go +++ b/asset/player.go @@ -19,7 +19,7 @@ func NewAudioPlayer() *AudioPlayer { log.Fatal("Failed to find audio file") } - player, err := oto.NewPlayer(44100, 2, 2, 8192) + c, err := oto.NewContext(44100, 2, 2, 8192) if err != nil { // it is expected to fail when some of the system // libraries are not available (e.g. libasound2) @@ -27,6 +27,7 @@ func NewAudioPlayer() *AudioPlayer { // so we allow startup in no-sound mode return nil } + player := c.NewPlayer() return &AudioPlayer{ player: player,