Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9271425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:36:58+00:00 2026-06-18T15:36:58+00:00

In my object, I got an AudioBufferSourceNode object ( this.bSrc ), connected to a

  • 0

In my object, I got an AudioBufferSourceNode object (this.bSrc), connected to a gain node (this.audioDestination) that plays a (valid) AudioBuffer already stored in the object (this.audioBuffer).

If this.audioDestination is connected to the audio context final destination this.mainContext.destination and I call the start(0) method on my AudioBufferSourceNode object (this.bSrc), it will play fine.

If, instead, this.audioDestination is not yet connected to the Audio Context final destination, the buffer won’t play (and it’s ok), but its playback will be delayed until the connection is made (thus invalidating any assumption on when the AudioBufferSourceNode finishes playing).

I’m currently implementing a plugin architecture, in which every plugin has its audioDestination gain node and doesn’t (and must not) know whether it is indirectly connected to the final Audio Context destination. What seems logical to me is that the AudioBufferSourceNode should ‘play’ immediately and finish, even if it’s not connected to the final Audio Context destination. But it seems it doesn’t work like this. Am I right or am I getting it wrong? Is there some way to change this behaviour?

Code:

/* Create the audio Context. */
this.mainContext = new webkitAudioContext;

/* Create an audio gain node */
this.audioDestination = this.mainContext.createGainNode();

/* [...] An AudioBuffer gets decoded and stored into this.audioBuffer*/

/* Create an AudioBufferSourceNode and try to play it immediately */
this.bSrc = this.audioContext.createBufferSource();
this.bSrc.connect (this.audioDestination);
this.bSrc.buffer = this.audioBuffer;
this.bSrc.start(0);

/* Create a callback for when the AudioBufferSourceNode finishes playing */
if (!this.bSrc.loop) {
       var pbTimer = setTimeout(function() {
            this.playFinishedCallback();
        }.bind(this), this.audioBuffer.duration * 1000 / this.bSrc.playbackRate.value);
    }

 /* Connect this.audioDestination to the final AudioContext destination */
 /* If this statement is executed after the previous ones, playback will start NOW */
 this.audioDestination.connect(this.mainContext.destination);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:37:00+00:00Added an answer on June 18, 2026 at 3:37 pm

    This is the way the Web Audio API is currently implemented in Chrome, and the design used therein. There’s been talk of changing it; in fact, I was a proponent of the “audio cable model” you describe. 🙂 It’s not the only sane model, though. There isn’t any way to change this behavior in current implementation.

    However, there is an easy workaround – simply keep a zeroed-out gain node connected to context.destination, and connect all your ABSNs to that as well as their (eventual) connection to the context.destination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ive got an object that looks like this with print_r(): SimpleDOM Object ( [0]
I've got an object with functions that throw errors, myObj = { ini:function(){ this.f();
I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I've got a Perl Moose object that contains an attribute I'd like to use
I got this object Person = Backbone.Model.extend({ defaults: { name: 'Fetus', age: 0, children:
I've got an object that has a type property. When the type is set
i got this object: SimpleXMLElement Object\n(\n [@attributes] => Array\n (\n [article_number] => 550007\n )\n\n
I've got 2 object arrays that Im getting from the DB, some overlap, so
I just var_dump'ed object and got something like this: object(simple_html_dom)#1 (23) { [root]=> object(simple_html_dom_node)#2
I have got odd problem while sending intent with parcelable object. This object has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.