drnf09037160
2015-02-18 18:57
浏览 893
已采纳

用golang播放音频文件

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.

图片转代码服务由CSDN问答提供 功能建议

如何用Go语言播放音频文件?

我有功能

我只是在一些基于Web浏览器的音乐播放器上找不到有关在go lang中播放声音文件的任何信息,但这并没有太大帮助。 / p>

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • dtmjl4427 2015-04-30 08:19
    最佳回答

    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

    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题