// This file is part of the 64k demo project. // It tests the core functionality of the audio synthesis engine. // Verifies voice triggering, registration, and rendering state. #include "audio/synth.h" #include #include void test_registration() { synth_init(); float data[DCT_SIZE * 2] = {0}; Spectrogram spec = {data, data, 2}; int id = synth_register_spectrogram(&spec); assert(id >= 0); assert(synth_get_active_voice_count() == 0); } void test_trigger() { synth_init(); float data[DCT_SIZE * 2] = {0}; Spectrogram spec = {data, data, 2}; int id = synth_register_spectrogram(&spec); synth_trigger_voice(id, 1.0f, 0.0f); assert(synth_get_active_voice_count() == 1); } int main() { printf("Running SynthEngine tests...\n"); test_registration(); test_trigger(); printf("SynthEngine tests PASSED\n"); return 0; }