music

command
v0.0.0-...-103f554 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

本示例我们设计并实现了一个音乐播放器程序。不是实现真正的播放界面和播放音 乐。我们会示范以下的关键流程:
(1) 音乐库功能,使用者可以查看、添加和删除里面的音乐曲目;
(2) 播放音乐;
(3) 支持MP3和WAV,但也能随时扩展以支持更多的音乐类型;
(4) 退出程序。
程序会是一个命令行程序,在运行后进入一个循环,用于监听命令输入的状态。该程序将接受以下命令。

  • 音乐库管理命令:lib,包括list/add/remove命令。
  • 播放管理:play命令,play后带歌曲名参数。
  • 退出程序:q命令。 使用示例:
$ go run mplayer.go 
Enter following commands to control the player: 
lib list -- View the existing music lib 
lib add <name><artist><source><type> -- Add a music to the music lib 
lib remove <name> -- Remove the specified music from the lib 
play <name> -- Play the specified music 
Enter command-> lib add HugeStone MJ ~/MusicLib/hs.mp3 MP3 
Enter command-> play HugeStone 
Playing MP3 music ~/MusicLib/hs.mp3 
.......... 
Finished playing ~/MusicLib/hs.mp3 
Enter command-> lib list 
1 : HugeStone MJ ~/MusicLib/hs.mp3 MP3 
Enter command-> lib view 
Enter command-> q

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL