1 个不稳定版本
0.1.0 | 2023年8月7日 |
---|
#651 in 音频
1MB
227 行
大自鸣钟
此应用程序的目标是在您的PC上提供与卡西欧(众所周知,它们的每小时蜂鸣声)、江诗丹顿 和 百达翡丽 等手表上相同的时辰和分钟报时功能。
安装
$ cargo install grande-sonnerie
使用方法
配置
首次启动时,将在 ~/.config/grande-sonnerie
创建两个默认配置文件:config.toml
和 casio.toml
,以及一个包含默认 coucou
动作 的目录。
config.toml
offset
负责设置时区sonnerie
将从同名目录加载声音movement
将加载同名配置以设置钟声
casio.toml
grand
是一个整数列表,其中grand
将报时hours
是一个定义它们将在哪些小时重复的整数列表hours_div
是一个整数,允许将小时均匀分割以报时。hours_div: 3
将使小时每三小时报时一次minutes
类似于hours
minutes_div
类似于hours_div
,但将小时分割成相等的部分。minutes_div: 15
将使分钟每十五分钟报时一次twelve_hour
13th hour will chime one time instead of thirteen etc (recommended withmultichime: true
)multichime
will make sounds repeat according to hour/minute, see examples below
Examples
Defaults
config.toml
:
offset = [0, 0, 0]
sonnerie = 'coucou'
movement = 'casio'
casio.toml
:
grand: none
hours: none
hours_div: 1
minutes: none
minutes_div: none
twelve_hour: false
multichime: false
UTC timezone, chimes once every hour with coucou/hour.wav
.
My personal config
config.toml:
offset = [3, 0, 0]
sonnerie = 'coucou'
movement = 'pp'
pp.toml
:
grand = [10, 18]
hours_div = 1
minutes_div = 15
twelve_hour = true
multichime = true
UTC+3, chimes
coucou/grand.wav
on 10:00 and 18:00 before everything elsecoucou/hour.wav
every hour, repeats according to the hours in 12h formatcoucou/minute.wav
every 15 minutes of an hour, repeats according to quarters of hour
So at 18:00 it will chime Grand, then Hour six times. At 18:45 it will just chime Minutes three times (45 is 3/4 of an hour).
Sounds
Three sounds are expected: grand
, hour
, and minute
. Currently only .wav
is supported
$ ffmpeg -i yoda-death-sound-effect.mp3 grand.wav
To do
- Implement arrays of sounds to play consecutively (Westminster chimes)
- Change CPU-eating sound implementation to something more sane
- Actual repeater (press a button to hear time)
Dependencies
~1–30MB
~456K SLoC