A cross-platform program to play music through PC speaker.
Chinese README is HERE
中文说明在 这里
inpout32 library used. Source code can be find HERE. License HERE.
Clone the repository or download ZIP, then
-
On Windows
Open beepplayer\beepplayer.sln with latest Visual Studio (VS 2017 for now), then select
Build-Build Solution -
On Linux
cd beepplayer/beepplayer/ makeIf you want the program to run as root automatically (potentially dangerous), run
make chmodThis will change the owner of the program to root, and set SUID.
First of all, you need some music score file, which can be found in beepplayer/beepplayer/demo/. The instruction for writing music score file can be found HERE.
Then, run the program with music score file as the last parameter.
- If you use windows, you can drag the music file to the executable file.
- If you use windows, use
-pto play withinpout32. (Can play with pc speaker on Windows 7 and above) - If you use Linux, run as root.
(sudo) ./beepplayer ./demo/somemusic.txt
- Deal with
^c() - Add some color to the lyric
- Wave (to stdout) for those pc without speaker
- Multi-thread: split play and display
一款让你的电脑蜂鸣器播放音乐的跨平台软件。
使用了开源的inpout32库。源代码可以在 这里 找到。许可在 这里。
请先克隆源或者下载zip包,然后
-
Windows
使用最新版本的Visual Studio(当前为Visual Studio 2017),打开beepplayer\beepplayer.sln,选择
生成-生成解决方案即可。 -
Linux
cd beepplayer/beepplayer make如果你希望在程序启动时自动获得root权限(有潜在风险),可以执行
make chmod将会把程序的所有者变为root,并设置SUID标记。
首先,你需要一些乐谱,示例可在beepplayer/beepplayer/demo/文件夹下找到。乐谱的编写规则可以在 这里 找到
然后,运行程序,并把乐谱作为最后一个参数传入。
- 在Windows下,可以将乐谱拖放到exe文件上来执行;
- 在Windows下,传入
-p参数可以使用inpout32播放(Win7以上直接调用蜂鸣器) - 在Linux下,请用root身份执行。
(sudo) ./beepplayer ./demo/somemusic.txt
- 正确处理
^c按键 - 歌词颜色
- 输出wave文件(到stdout),以便无蜂鸣器电脑使用
- 多线程:播放和显示分离