package play
import (
"fmt"
"time"
)
type MP3Player struct {
stat int
progress int
}
func (p *MP3Player)Play(source ,name string) {
fmt.Printf("\nPlaying %s MP3 music 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 Playing %s from %s\n",name,source)
}