/**
@author CuiZhouwei
@date 2022/7/29
**/
package play
import (
"fmt"
"time"
)
type WAVPlayer struct {
stat int
progress int
}
func (p *WAVPlayer) Play(source, name string) {
fmt.Printf("\nPlaying music %s WAV type now ,from %s\n", name, source)
p.progress = 0
for 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)
}