Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
Web audio: Output to center speaker only

I'm playing around with the web audio context and trying to understand how the splitter node works.

I've managed to split an oscillator node and connect it to output only to the left/right channels, but I'm having some hard time outputting it to the "center" channel alone...

given the following code

    const ac = new AudioContext();
    const splitter = ac.createChannelSplitter(6);
    const oscilator = ac.createOscillator();
    const merger = ac.createChannelMerger(6);
    oscilator.frequency.value = 440;
    
    const gainNode = ac.createGain();

    // connect oscilator to splitter channel
    oscilator.connect(splitter);

    gainNode.gain.setValueAtTime(0.5, ac.currentTime);
    splitter.connect(gainNode, 0);
    gainNode.connect(merger, 0, 2);
    merger.connect(ac.destination);

    oscilator.start(0);
    oscilator.stop(1);

I expect the oscillator tune to be outputted only in my "center" speaker, but I hear the sound from both.

what am I missing?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!