Skip to content

Run RemixAndResample on a background thread#272

Draft
MaxHeimbrock wants to merge 1 commit intomainfrom
max/audiostream-resample-worker
Draft

Run RemixAndResample on a background thread#272
MaxHeimbrock wants to merge 1 commit intomainfrom
max/audiostream-resample-worker

Conversation

@MaxHeimbrock
Copy link
Copy Markdown
Contributor

The FFI callback thread is OS-audio-scheduled, so per-frame resample DSP there competes with Unity's audio rendering. Move the work to a dedicated per-stream worker thread fed by a bounded BlockingCollection. The FFI handler now just enqueues; the worker drains, resamples, and writes into the existing 200ms ring buffer that absorbs the small extra hop.

Background

Why are you doing this change? For example:

Token generation was too hard, so ...

Changes

What did you do?

  • Added new mechanism to generate tokens based on sandbox server id
  • ...

The FFI callback thread is OS-audio-scheduled, so per-frame resample DSP
there competes with Unity's audio rendering. Move the work to a dedicated
per-stream worker thread fed by a bounded BlockingCollection. The FFI
handler now just enqueues; the worker drains, resamples, and writes into
the existing 200ms ring buffer that absorbs the small extra hop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant