# Amberwave Windows Client Client for the Amberwave server (not to be confused with a later Amberwave Windows Server): shows the web app of your own server in a window (Electron) and plays through a dedicated audio engine – bit-perfect via WASAPI exclusive, gapless, sample rate follows the file. Admin, library, accounts and presets stay on the server. ## Structure - `client/` – Electron shell (`main.js`), bridge to the web app (`preload.js`), server discovery on the home network (`suche.js`), setup page (`einrichtung.html`). - `engine/` – audio engine in C: download (WinHTTP), FLAC (dr_flac), ring buffer with track/format/end markers, output via WASAPI (`ausgabe_wasapi.c`). Controlled via JSON lines on stdin/stdout (commands and messages: see the header of `engine.c`). `ausgabe_test.c` and `netz_posix.c` are a test device and HTTP for Linux (automated tests). - Sound chain in the engine (`engine/klang.c`): Glow, Iron, Silk and EQ from the shared C library `dsp/` (exact port of the worklets), order freely selectable, rebuilds with a 60 ms crossfade. Without an active stage the integer path keeps running (bit-perfect). Loudness matching per track (`gain` on `laden`/`vormerken`) switches sample-accurately at the track boundary. Measurement points (input, before/after EQ, measurement point after chain and matching) go as 16-bit PCM to the web app (`app/js/abgriff.js`), where meters, rack and analysis run unchanged. - Space: the web app builds the graph as in the browser against `app/js/raumnativ.js`, the engine computes it with `dsp/raumgraph.c` (upmix, convolution, filters, bass management) after the chain and before the matching. For this the device is opened with the channels of the layout (5.1/quad, speaker mask of the device); stereo stays bit-perfect on it as soon as Space is off again. Impulse responses are sent to the engine once as data. - ASIO (`engine/ausgabe_asio.c`, interface in `engine/asio.h` – our own description of the driver ABI, without the Steinberg SDK): drivers from the registry appear as “ASIO · …” in the device list. The driver runs in its own thread (COM as STA); the engine writes in the driver’s format (Int16/24/32, Float32/64, Int32 with 16–24 bits) into a ring buffer (100 ms), the callback distributes to the channels – bit-perfect, sample rate of the file, Space with 6 channels. Reset requests from the driver (buffer size/rate changed in the driver window) reopen the device; the driver window is opened by the command `asio_einstellungen` (Profile and quality menu). On Linux a driver dummy (`engine/asio_attrappe.c`) is used for testing. - ASIO rate change: the same driver is only reconfigured (stop, rate, buffers anew, continue) instead of being unloaded and reloaded – only the switching time of the interface remains. - Fixed output rate (Profile → “Sample rate at device”): `engine/geraet.c` opens the device at this rate and converts the source with `dsp/umrechner.c` (polyphase FIR, Kaiser sinc, passband up to 90.7 % of the smaller Nyquist frequency, 150 dB stopband attenuation, linear phase; measurement `dsp/tests/umrechner_test.py`: residual −146 … −154 dB, image/alias ≤ −155 dB). Changes of the source rate are seamless, the device keeps running; the same rate stays bit-perfect. Output with TPDF dither at 16/24 bit. - Title bar: the header bar of the web app is the title bar (`titleBarOverlay`, color from `theme-color`), the Windows buttons stay native. Fullscreen views (large player view, effects rack) turn their top row into the title bar, leave room on the right for the buttons and set the matching title color (theme-color). - Identification at the server: `AmberwaveClient/ ()` in the user agent – the admin area shows the device as “ · Windows Client”. - The web app recognizes the client by `window.amberwaveNativ` and replaces the `