Sync NAM engine block_size with JACK period on profile switch
- Add FastNAMHost.set_block_size() — reloads current model with new block_size, keeping the engine in sync with JACK's period - Wire into POST /api/audio/profile so NAM engine restarts with correct frame count when switching between standard/low/stable - Prevents sample-alignment drift when JACK period changes but NAM engine stays at old block_size (was causing passthrough)
This commit is contained in:
@@ -1361,6 +1361,10 @@ class WebServer:
|
||||
# Restart JACK audio client
|
||||
if jack_client:
|
||||
jack_client.start()
|
||||
# Sync NAM engine block size with new period
|
||||
nam_host = self.deps.nam_host
|
||||
if nam_host and hasattr(nam_host, 'set_block_size'):
|
||||
nam_host.set_block_size(profile["period"])
|
||||
await self._manager.broadcast({
|
||||
"type": "audio_profile_changed",
|
||||
"profile": profile_key,
|
||||
|
||||
Reference in New Issue
Block a user