JACK (virtual soundcard)

JACK is a virtual sound card driver. It enables to interconnect programs audio IO together, and with real soundcards too.

You can use JACK extension and ASIO extension to address many hardware IO (eg, outputing signal to multiple listeners or array of speakers). JACK extension is only available for Unix systems.

  1. Inputs
  2. Outputs
  3. Samples

Inputs

Jack Input

Creates a jack client with multiple input ports. Allows you to send audio from other programs or soundcards to Audiostack diagram.

I/O Channel count Sub channel count
out 1 M (see construction)

Construction

  • subChannelCount (unsigned int) : The number of input ports to create on a new jack client.

Sample usage to send 4 channel to this input (for instance for FOA acquisition):

context.createInput(ID,JackInput,4U);

Parameters

ΓΈ

Global parameters used by this IO :

  • application/buffer_size


Outputs

Jack Output

Creates a jack client with multiple output ports. Allows you to send audio from Audiostack to other programs or soundcards.

It can be used to output multi-speaker output, or multiple headphones.

I/O Channel count Sub channel count
in N M (see construction)

Construction

  • subChannelCount (unsigned int) : The number of input ports to create on a new jack client.

Sample usage to expose a 8 channel output on jack (for instance in combination with 8 speaker spatialization):

context.createInput(ID,JackOutput,8U);

Parameters

Runtime
  • master_gain (float) : master gain of this output (amplitude).

    This parameter is mapped by default to listener/%list_id/master_gain.

    Usage :

    context.setParameter("listener/2/master_gain",0.5f)
    

Global parameters used by this IO :

  • application/buffer_size



Code samples

For more code samples, see JACK samples

JACK spatialization

This sample spatializes hello input for one listener. The output-jack-client must be connected to a hardware output and/or another program.

[...]

enum:int{helloId = 0, outputId = 1, busId, spatId};

// Please launch your jack daemon before running audiostack.

AudiostackContext context;
context.setLicenseKeyFromFile("LICENSE.aslc");

context.createInput(helloId, HelloInput);
context.createOutput(outputId, JackOutput, 2U);                 
// Output has 2 channel, because binaural effect produces a stereo output.

context.createBus(busId);                                       
context.createEffect(spatId,busId,BinauralSpatializationAspic);

context.connect(helloId,busId);
context.connect(busId,outputId);

context.play();


context.connect(0,1);

context.play();

char c;
do{
	std::cout<<"Feel free to connect jack ports (with program such as 'qjackctl').\n\tPress q to quit."<<std::endl;
	std::cin>>c;

	// Here, move source and listener!

}while(c!='q');

context.stop();

[...]

For more code samples, see JACK samples