(摘) Golang播放wav

声明:内容源自网络,版权归原作者所有。若有侵权请在网页聊天中联系我
package main

import (
        "os"

        "github.com/aerth/playwav"
)

func main() {
        if len(os.Args) < 2 {
                print("What .WAV file to play?\n")
                return
        }

        for _, filename := range os.Args[1:] {
                print(filename + "\n")
                wavinfo, err := playwav.FromFile(filename)
                if err != nil {
                        print(err.Error() + "\n")
                }

                print(wavinfo + "\n")
        }
}

相关文章