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.

JACK extension doc can be found here.

  1. JACK bypass
  2. Spatialization to JACK

JACK bypass

This sample creates one mono input client and one mono output client. It is a sample bypass application.

[...]

// Please launch your jack daemon before running audiostack.

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

context.createInput(0,JackInput, 1U);
context.createOutput(1,JackOutput,1U);

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;
}while(c!='q');

context.stop();

[...]

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();

[...]