Reorganize files by basename and add config.js

- Move input files to input/amuta_2026-01-12_1/
- Move output files to outputs/{format}/amuta_2026-01-12_1/
- Create config.js with Pythonic-style configuration
- Update app.js to use CONFIG values
- Update index.html to load config.js
- Update .gitignore (exclude large audio files, track only .opus)
This commit is contained in:
5shekel
2026-01-18 01:21:40 +02:00
parent c75991127c
commit fddda9727a
13 changed files with 24495 additions and 25 deletions

10
.gitignore vendored
View File

@@ -1,2 +1,8 @@
input/
outputs/
# Node modules
node_modules/
# Large audio files (keep only .opus)
*.flac
*.ogg
*.wav
*.mp3

34
app.js
View File

@@ -27,12 +27,15 @@ const spectrogramOverlayCtx = spectrogramOverlay.getContext("2d");
const embeddedWaveformCtx = embeddedWaveformCanvas ? embeddedWaveformCanvas.getContext("2d") : null;
const embeddedWaveformOverlayCtx = embeddedWaveformOverlay ? embeddedWaveformOverlay.getContext("2d") : null;
const transcriptPath = "outputs/float32/amuta_2026-01-12_1.json";
const waveformPath = "outputs/float32/amuta_2026-01-12_1.waveform.json";
const START_OFFSET_SECONDS = 600;
const SPEAKER_LABELS = {
// Example: "SPEAKER_01": "Maya",
};
// Use values from config.js
const transcriptPath = CONFIG.transcript_path;
const waveformPath = CONFIG.waveform_path;
const START_OFFSET_SECONDS = CONFIG.start_offset_seconds;
const SPEAKER_LABELS = CONFIG.speaker_labels;
const palette = CONFIG.palette;
// Set audio source from config
audio.src = CONFIG.audio_path;
const state = {
speakers: [],
@@ -48,24 +51,11 @@ const state = {
stars: [],
spaceSize: { width: 0, height: 0 },
waveformSize: { width: 0, height: 0 },
transcriptRows: 6,
transcriptOpacity: 0.85,
transcriptSize: "medium",
transcriptRows: CONFIG.transcript.rows,
transcriptOpacity: CONFIG.transcript.opacity,
transcriptSize: CONFIG.transcript.size,
};
const palette = [
"#52f0c5",
"#ffb347",
"#ff7aa2",
"#9cbbff",
"#f4d35e",
"#7bffd2",
"#ffb4a2",
"#b8e1ff",
"#ffd36d",
"#d0b3ff",
];
function formatTime(seconds) {
if (!Number.isFinite(seconds)) return "0:00";
const mins = Math.floor(seconds / 60);

81
config.js Normal file
View File

@@ -0,0 +1,81 @@
/**
* Configuration file for Amuta Space Talkers
*
* Edit this file to customize the application settings.
* Pythonic style: clear naming, organized sections.
*/
const CONFIG = {
// ===================
// FILE PATHS
// ===================
// Base name for the meeting (used to construct file paths)
meeting_name: "amuta_2026-01-12_1",
// Directory structure
input_dir: "input",
output_dir: "outputs",
output_format: "float32", // "float32" or "int8"
// Audio file extension
audio_extension: ".opus",
// ===================
// PLAYBACK
// ===================
// Start offset in seconds (skip intro/silence)
start_offset_seconds: 600,
// ===================
// SPEAKER LABELS
// ===================
// Map speaker IDs to display names
// Example: { "SPEAKER_01": "Maya", "SPEAKER_02": "David" }
speaker_labels: {
// "SPEAKER_01": "Maya",
},
// ===================
// TRANSCRIPT DEFAULTS
// ===================
transcript: {
rows: 6, // Number of transcript lines shown (2-12)
opacity: 0.25, // Transcript panel opacity (0.2-1.0)
size: "medium", // Text size: "small", "medium", "large"
},
// ===================
// COLOR PALETTE
// ===================
// Speaker colors (cycles through for each speaker)
palette: [
"#52f0c5",
"#ffb347",
"#ff7aa2",
"#9cbbff",
"#f4d35e",
"#7bffd2",
"#ffb4a2",
"#b8e1ff",
"#ffd36d",
"#d0b3ff",
],
};
// ===================
// DERIVED PATHS (computed from config)
// ===================
CONFIG.audio_path = `${CONFIG.input_dir}/${CONFIG.meeting_name}/${CONFIG.meeting_name}${CONFIG.audio_extension}`;
CONFIG.transcript_path = `${CONFIG.output_dir}/${CONFIG.output_format}/${CONFIG.meeting_name}/${CONFIG.meeting_name}.json`;
CONFIG.waveform_path = `${CONFIG.output_dir}/${CONFIG.output_format}/${CONFIG.meeting_name}/${CONFIG.meeting_name}.waveform.json`;
// Export for use in app.js
if (typeof module !== 'undefined' && module.exports) {
module.exports = CONFIG;
}

View File

@@ -66,7 +66,8 @@
</section>
</main>
<audio id="audio" preload="metadata" src="input/amuta_2026-01-12_1.opus"></audio>
<audio id="audio" preload="metadata"></audio>
<script src="config.js"></script>
<script src="app.js"></script>
</body>
</html>

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff