From 6db1714d0354d1e1105e330ce84c46a54487c3bb Mon Sep 17 00:00:00 2001 From: Tom Cooks Date: Wed, 30 Sep 2026 08:49:02 -0400 Subject: Main-screen recordings list, player actions, background recording, exports (1.4.0-alpha) - Main screen: recordings list at the bottom (newest first); removed the separate library screen and the top-right link - Player: delete/rename/share/export, no autoplay, embedded-marker fallback - Word-level tap-to-seek from Whisper token timestamps (length fallback) - Export transcripts as .txt + .srt to Downloads - RecordingService: microphone foreground service for background recording - FileProvider for sharing on Android 9 and older - StreamingResampler extracted to its own class + JUnit regression tests - Bump to 1.4.0-alpha (versionCode 6) --- .../com/wuhei/reccoon/StreamingResamplerTest.java | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/src/test/java/com/wuhei/reccoon/StreamingResamplerTest.java (limited to 'app/src/test/java/com') diff --git a/app/src/test/java/com/wuhei/reccoon/StreamingResamplerTest.java b/app/src/test/java/com/wuhei/reccoon/StreamingResamplerTest.java new file mode 100644 index 0000000..6e4cdcd --- /dev/null +++ b/app/src/test/java/com/wuhei/reccoon/StreamingResamplerTest.java @@ -0,0 +1,41 @@ +package com.wuhei.reccoon; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import java.util.Random; + +/** Regression tests for the streaming resampler. */ +public class StreamingResamplerTest { + + @Test + public void longStreamOfFullChunksDoesNotThrow() { + StreamingResampler resampler = new StreamingResampler(44100, 16000); + float[] chunk = new float[8192]; + long total = 0; + for (int i = 0; i < 400; i++) { + for (int j = 0; j < chunk.length; j++) { + chunk[j] = (float) Math.sin((i * 8192 + j) * 0.01); + } + total += resampler.process(chunk).length; + } + assertTrue(total > 1_000_000); + } + + @Test + public void oddChunkSizesDoNotThrow() { + StreamingResampler resampler = new StreamingResampler(44100, 16000); + Random random = new Random(1); + long total = 0; + for (int i = 0; i < 3000; i++) { + int n = 1 + random.nextInt(3000); + float[] chunk = new float[n]; + for (int j = 0; j < n; j++) { + chunk[j] = random.nextFloat() * 2f - 1f; + } + total += resampler.process(chunk).length; + } + assertTrue(total > 0); + } +} -- cgit v1.2.3