/**@author CuiZhouwei@date 2022/7/29**/package playimport ("fmt""time")type WAVPlayer struct {stat intprogress int}func (p *WAVPlayer) Play(source, name string) {fmt.Printf("\nPlaying music %s WAV type now ,from %s\n", name, source)p.progress = 0for p.progress < 100 {time.Sleep(100 * time.Millisecond) //假装正在播放fmt.Printf("the music %s playing\n", name)p.progress += 10}fmt.Printf("\nFinish %s music from %s \n", name, source)}
