Skip to content
Discussion options

You must be logged in to vote

Hi!

Own processing thread (if you don't need playback, just processing)
Don't add the inputSource to the mixer — call ReadSamples() in a dedicated thread:

var config = OwnaudioNet.CreateDefaultConfig();
config.EnableInput = true;
OwnaudioNet.Initialize(config);

InputSource? inputSource = null;
CancellationTokenSource? cts = null;
Task? processingTask = null;

if (OwnaudioNet.IsInitialized)
{
    OwnaudioNet.Start();

    if (OwnaudioNet.IsRunning)
    {
        inputSource = new InputSource(OwnaudioNet.Engine!, bufferSizeInFrames: 8192);

        // Watch for data loss
        inputSource.BufferUnderrun += (s, e) =>
            Console.WriteLine($"WARNING: {e.DroppedFrames} frame lost!");

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@gitxab113
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gitxab113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants