Skip to content
New issue

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

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

Already on GitHub? # to your account

Write out an audio file #26

Open
mohayonao opened this issue Nov 1, 2013 · 6 comments
Open

Write out an audio file #26

mohayonao opened this issue Nov 1, 2013 · 6 comments

Comments

@mohayonao
Copy link
Owner

No description provided.

@lisongx
Copy link

lisongx commented Jan 6, 2014

👍 we need this:)

@hems
Copy link

hems commented May 20, 2014

The way i achieved that:

  1. add recorder.js

  2. run your CC code, so the object "cc.impl.api.jsNode" gets created ( i guess its only created the first time you run something )

  3. plug then together then use the recorder api:

    @rec = new Recorder cc.impl.api.jsNode,
        workerPath: "vendor/recorderjs/recorderWorker.js"
    

@mohayonao
Copy link
Owner Author

cc.impl.api.jsNode refers to the deep internal structure.
you should use cc.getWebAudioComponents() instead.

cc.getWebAudioComponents() returns an array that contains AudioContext and ScriptProcessorNode (this ScriptProcessorNode is same of cc.impl.api.jsNode).

[ context, jsNode ] = cc.getWebAudioComponents()
@rec = new Recorder jsNode,
    workerPath: "vendor/recorderjs/recorderWorker.js"

ScriptProcessorNode is created after cc.play at first time.

@hems
Copy link

hems commented May 21, 2014

awesome! thanks for the explanation !

And is there a way of getting one "jsNode" for each block of executed code?

@mohayonao
Copy link
Owner Author

jsNode is created at only once and it is shared by every code.

but, multiple nodes..
it may be very good idea to be used as multitrack.

thanks!

@hems
Copy link

hems commented May 30, 2014

exactly!

the way i see is: when you run a code you shall be able to get a node for that, and all nodes by default are connected to the "main" jsNode from "cc" which is the one that goes to the output.

but being able to retrieve the node for each execution will give you extra routing options, you will be able to mix them from and external GUI, or route it through some non-coffee-collider efx, etcs.

awesome stuff @mohayonao ! thanks

keep rocking!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants