From d437d9171e958791f3d6cdfc7ad0c2df701f11f4 Mon Sep 17 00:00:00 2001 From: Chris Frankland-Wright <85807217+cjfranko@users.noreply.github.com> Date: Mon, 7 Jul 2025 00:13:29 +0100 Subject: [PATCH] Delete test_audioinput.py --- test_audioinput.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 test_audioinput.py diff --git a/test_audioinput.py b/test_audioinput.py deleted file mode 100644 index 213e1a4..0000000 --- a/test_audioinput.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 - -""" -test_audioinput.py -Records 2 seconds of audio from the default input device -and saves the waveform as 'waveform.png' — works headless. -""" - -import numpy as np -import matplotlib -matplotlib.use('Agg') # Headless backend -import matplotlib.pyplot as plt -import sounddevice as sd - -DURATION = 2 # seconds -SAMPLERATE = 48000 -CHANNELS = 1 - -print("🔊 Recording 2 seconds from default input device...") -recording = sd.rec(int(DURATION * SAMPLERATE), samplerate=SAMPLERATE, channels=CHANNELS, dtype='float32') -sd.wait() - -# Generate time axis -time_axis = np.linspace(0, DURATION, len(recording)) - -# Plot and save -plt.figure(figsize=(10, 4)) -plt.plot(time_axis, recording, linewidth=0.5) -plt.title("Audio Input Waveform") -plt.xlabel("Time [s]") -plt.ylabel("Amplitude") -plt.grid(True) -plt.tight_layout() -plt.savefig("waveform.png") - -print("✅ Waveform saved as 'waveform.png'")