1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/packages/noise-waves.nix
2024-09-19 09:54:12 +02:00

18 lines
544 B
Nix

{ sox, mpv, writers, coreutils }:
# ref https://askubuntu.com/a/789472
writers.writeDashBin "noise-waves" ''
file="/tmp/noise-$(${coreutils}/bin/date +%s | ${coreutils}/bin/md5sum | ${coreutils}/bin/cut -d' ' -f1).wav"
trap clean EXIT
clean() {
rm "$file"
}
${coreutils}/bin/mkfifo "$file"
${sox}/bin/sox -c2 -r44.1k -b8 -n "$file" synth brownnoise synth pinknoise mix synth sine amod 0.3 10 &
${mpv}/bin/mpv "$file"
''
# play -c2 -r44.1k -b8 -n synth -1 brownnoise .1 40
# play -c2 -r44.1k -b8 -n synth -1 pinknoise .1 60