Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio Channel routing #41

Open
ghost opened this issue Nov 23, 2012 · 4 comments
Open

Audio Channel routing #41

ghost opened this issue Nov 23, 2012 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 23, 2012

I'd like to be able to route audio coming from Audiolet to the audio channels of the OS. I see that Audiolet has internal channels and routing capabilities, is there a way to hook into these channels using something like Soundflower?

I am working on a project that includes remixing streaming internet audio. I've hit a stumbling block at being able to access independent audio streams. Browsers send audio exclusively on channels 1 and 2 AFAIK.

Any help/ideas greatly appreciated.

@oampo
Copy link
Owner

oampo commented Nov 24, 2012

Hm, I think this is currently difficult - as you said the audio API implementations only allow you to send audio on channels 1 and 2. As far as I can tell multichannel output is a planned feature for the Web Audio API, but the implementations are stereo-only at the moment.

One possibility would be to create a node which chucks the audio data through a WebSocket to an application running outside the browser, which then passes that to the audio output. I have no idea whether WebSockets are up to passing that much data with any sort of reliability though, and I can only imagine that results will be flaky at best.

If I think of any better ideas I'll post them up here, but I have a feeling that this will be a matter of waiting for the implementations to work with multiple channels (at which point it will be simple to route Audiolet data to whichever channel you want).

@ghost
Copy link
Author

ghost commented Mar 21, 2013

@oampo
Copy link
Owner

oampo commented Apr 2, 2013

Sorry for the late reply - I've been super busy and my brain skipped over this. Awesome news though. I've just had a quick glance through all the code concerning this and as far as I can tell it should work automagically with multi-channel output. All you need to do it give a different numberOfChannels argument when you create the Audiolet object, and set up your routing accordingly. I don't really have a good way of testing this at the moment, so YMMV. If you try it out I'd be interested to know how it goes.

@jenyckee
Copy link

Can someone make a gist of how to make this work? It looks like a very desirable feature to me to be able to route your audio into external applications like a DAW.

Imagine I have this:

context = new AudioContext;
oscillator = context.createOscillator();
oscillator.frequency.value = 200;

oscillator.connect(context.destination);

oscillator.start(0);

how could I route this into soundflower and use the audio output directly somewhere outside the browser?

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

No branches or pull requests

2 participants