# Uso: python3 -I beeps.py # O autor do Terminus gravou char.wav e grl.wav (a "voz" do texto digitado, CC0) mas os arquivos nao estao no repositorio (o .gitignore # exclui *.wav) nem em outro lugar publico. Aqui entram dois bipes curtos nossos, gerados por este script (CC0), com o mesmo nome. import math, struct, sys, wave def beep(path, freq, ms, shape, vol): rate = 22050 n = rate * ms // 1000 frames = bytearray() for i in range(n): t = i / rate ph = (t * freq) % 1.0 if shape == 'square': s = 1.0 if ph < 0.5 else -1.0 else: s = 2.0 * ph - 1.0 env = min(1.0, i / 40.0) * (1.0 - i / n) ** 1.5 frames += struct.pack('