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

Possible bug with offset #65

Closed
catz opened this issue Jul 18, 2019 · 3 comments
Closed

Possible bug with offset #65

catz opened this issue Jul 18, 2019 · 3 comments

Comments

@catz
Copy link

catz commented Jul 18, 2019

Hello Ben,

I'm not really sure but there might be a bug with offset in bufferNode. But I can't figure out the reason. Basically everything looks the same. Offset is passed into audioNode.start(startTime, offsetTime);

Here is the example repo
https://github.com/catz/vag-offset

Plays with correct offset

        ....
        source.buffer = sampleBuffer;
        source.playbackRate.value = 0.19971255630630633;
        source.offsetTime = null;
        source.start(context.currentTime, 0.5813333333333334);
        ...

But this one plays always from the start

          ....
          virtualAudioGraph.update({
                                   0: gain('output', { gain: 0.2 }),
                                   1: bufferSource(0, {
                                        buffer: sampleBuffer,
                                        playbackRate : 0.19971255630630633,
                                        loop: false,
                                        startTime: currentTime,
                                        offsetTime: 0.5813333333333334
                                      })
                                   });

Thank you for your library. Works fine with Elm lang

@benji6
Copy link
Owner

benji6 commented Jul 19, 2019

Hey, thanks for reporting this, I should be able to take a proper look over the weekend and get back to you

@benji6
Copy link
Owner

benji6 commented Jul 19, 2019

I've pushed a fix for this and it's released here https://github.com/benji6/virtual-audio-graph/releases/tag/v1.1.5

It was an interesting issue because it was working fine in Firefox but not Chrome. I think the cause was that virtual-audio-graph was calling start on the buffer source node before setting the buffer. I've fixed this and the problem seems to be resolved now.

Let me know if you have any other issues and thanks for the test case it was very helpful!

@benji6 benji6 closed this as completed Jul 19, 2019
@catz
Copy link
Author

catz commented Jul 20, 2019

works like a charm. thank you

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