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

I don't believe you are actually sending with transferrables #7

Open
gordyr opened this issue Aug 26, 2014 · 0 comments
Open

I don't believe you are actually sending with transferrables #7

gordyr opened this issue Aug 26, 2014 · 0 comments

Comments

@gordyr
Copy link

gordyr commented Aug 26, 2014

Please forgive me if I am incorrect but I was of the understanding that you can only send an array of ArrayBuffers as transferable objects?

In your worker.js file you have the following:

 // use transferrable objects
        var buffers = [];
        for (var i in result.outputFiles) {
            buffers.push(result.outputFiles[i]);
        }

        postMessage({
            'type' : 'done',
            'data' : result
        }, buffers);

Which causes the buffers array to be as follows:

buffers = [{
     name : filename.mp3,
     data : ArrayBuffer
}]

Therefore the object get copied rather than transferred. I'm not 100% on this as i'm relatively new to webworkers, but from all the reading I've done this appears to be the case.

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

1 participant