Extend pre-impact pause and synchronize both call timers

This commit is contained in:
Codex
2026-10-30 01:49:04 +02:00
parent 56d9af9d2e
commit 5b8d60b1f6
12 changed files with 136 additions and 47 deletions
+5 -2
View File
@@ -1,15 +1,18 @@
"""Original fictional distant hum; no sampled real-world attacks."""
from pathlib import Path
import math
import json
import struct
import wave
target = Path(__file__).resolve().parents[1] / "do-otboy/assets/audio/approach.wav"
story = json.loads((target.parents[2] / "data/phone_story.json").read_text(encoding="utf-8"))
duration = story["timeline"]["impact"] - story["timeline"]["hum"]
rate = 22050
samples = []
for i in range(rate * 6):
for i in range(round(rate * duration)):
t = i / rate
envelope = min(1, t / 2) * min(1, (6 - t) / .3)
envelope = min(1, t / 2) * min(1, (duration - t) / .3)
signal = .22 * math.sin(2 * math.pi * (68 * t + .6 * t * t))
signal += .08 * math.sin(2 * math.pi * 137 * t)
signal += .03 * math.sin(2 * math.pi * 281 * t)