33d5cfc393
date: 2025-12-18T23:23:16 master commit: 3cdee7b54718ee14bd85befd6c5bad3d699c5479
20 lines
554 B
Python
20 lines
554 B
Python
import numpy as np
|
|
from scipy.io import wavfile
|
|
|
|
|
|
sr = 48000
|
|
max_int16 = 2**15 - 1
|
|
|
|
def harmonic_beep(freq, duration_seconds):
|
|
n_total = int(sr * duration_seconds)
|
|
|
|
signal = np.sin(2 * np.pi * freq * np.arange(n_total) / sr)
|
|
x = np.arange(n_total)
|
|
exp_scale = np.exp(-x/5.5e3)
|
|
return max_int16 * signal * exp_scale
|
|
|
|
engage_beep = harmonic_beep(1661.219, 0.5)
|
|
wavfile.write("engage.wav", sr, engage_beep.astype(np.int16))
|
|
disengage_beep = harmonic_beep(1318.51, 0.5)
|
|
wavfile.write("disengage.wav", sr, disengage_beep.astype(np.int16))
|