This repository was archived by the owner on Nov 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
This repository was archived by the owner on Nov 18, 2023. It is now read-only.
Process Audio #3
Copy link
Copy link
Open
Description
Hi, thank for this project.
My idea is get sound of the micro of my computer, distortion it and send the distortion sound to the output (Speaker).
This is my code:
private Jack.CSCore.AudioIn _soundIn;
private Jack.CSCore.AudioOut _soundOut;
private JackSharp.Processor _client;
CSCore.Streams.Effects.DmoDistortionEffect _distortionEffect;
private CSCore.Streams.SoundInSource _source;
private void StartProcess()
{
try
{
_client = new JackSharp.Processor("TESTING", 2, 2, 0, 0, true);
_soundIn = new Jack.CSCore.AudioIn(_client);
_soundIn.Initialize();
_source = new CSCore.Streams.SoundInSource(_soundIn);
_distortionEffect = new CSCore.Streams.Effects.DmoDistortionEffect(_source);
_distortionEffect.Edge = 10;
_distortionEffect.PreLowpassCutoff = 4800;
_soundOut = new Jack.CSCore.AudioOut(_client);
_soundOut.Initialize(_distortionEffect);
_client.Start();
_soundOut.Play();
}
catch (Exception ex)
{
Console.WriteLine("Exception in StartProcess: " + ex.Message);
}
}
private void StopFullDuplex()
{
if (_client != null)
{
_client.Stop();
_client.Dispose();
}
if (_soundOut != null) _soundOut.Dispose();
if (_soundIn != null) _soundIn.Dispose();
}
These are the JAckAudio connections:

This code don't work. I don't listen the micro by the Blackwire (headphones) output.
Only listen the sound by the output if I add the event CopyInToOut to the Processor (without distortion)
JackSharpTest.Dummies.ClientReceiver receiver = new JackSharpTest.Dummies.ClientReceiver();
_client.ProcessFunc += receiver.CopyInToOutAction;
void CopyInToOut (ProcessBuffer processItems)
{
for (int i = 0; i < Math.Min (processItems.AudioIn.Length, processItems.AudioOut.Length); i++) {
Array.Copy (processItems.AudioIn [i].Audio, processItems.AudioOut [i].Audio, processItems.AudioIn [i].BufferSize);
}
Called++;
}
How must I process the sound through CSCore for distorsion the input and send the result to the output of the 'TESTING' JackSharp.Processor?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels