Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asset/player.go: Replace NewPlayer with NewContext for oto 0.6.0 and after #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion asset/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ 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)
// it is not the main functionality of the application,
// so we allow startup in no-sound mode
return nil
}
player := c.NewPlayer()

return &AudioPlayer{
player: player,
Expand Down