Playing audio file with golang

go

Solution

You could use the PortAudio Go bindings (`go get github.com/gordonklaus/portaudio`) for this.

You will have to build or install PortAudio on your system. Consult http://portaudio.com/docs/v19-doxydocs/tutorial_start.html for this.

A complete example for playing back a sound file is located at https://github.com/gordonklaus/portaudio/blob/master/examples/play.go

Problem

How one would play audio file in go language? I have function and want sound to be played as notification when event happens. I could not find anything about playing sound file in go lang just some web browser based music players but it wasnt helpful too much.

Original source