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 7772215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:50:17+00:00 2026-06-01T16:50:17+00:00

I am trying to save the output from webAudio API for future use ,

  • 0

I am trying to save the output from webAudio API for future use , so far i think getting PCM data and saving it as a file will do my expectation , I am wondering if the webAudio or mozAudio already supports saving the output stream if not how can i get the pcm data from the output stream

  • 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-01T16:50:18+00:00Added an answer on June 1, 2026 at 4:50 pm

    There isn’t a good sense of the requirements here outside of attempting to capture web audio in some programmatic way. The presumption here is you want to do this from code executing in JavaScript on the page that’s currently being browsed, but that also isn’t entirely clear.

    As Incognito points out, you can do this in Chrome by using a callback hanging off decodeAudioData(). But, this may be overly complicated for your uses if you’re simply trying to capture, for example, the output of a single web stream and decode it into PCM for use in your sound tools of choice.

    Another strategy you might consider, for cases when the media URL is obscured or otherwise difficult to decode using your current tools, is capture from your underlying sound card. This gives you the decoding for free, at the potential expense of a lower sampling rate if (and only if) your sound card isn’t able to sample the stream effectively.

    As we know, you’re already encoding analog signals digitally anyway via your desire for PCM encoding. Obviously, only do this if you have the legal right to use the files being sampled.

    Regardless of the route you choose, best of luck to you. Be it programmatic stream dissection or spot sampling, you should now have more than enough information to proceed.


    Edit: Based on additional information from the OP, this seems like the needed solution (merged from here and here, using NodeJS’ implementation of fs):

    var fs = require('fs');
    
    function saveAudio(data, saveLocation) {
        var context = new (window.AudioContext || window.webkitAudioContext)();
        var source = context.createBufferSource();
    
        if(context.decodeAudioData) {
            context.decodeAudioData(data, function(buffer) {
                fs.writeFile(saveLocation, buffer, function (err) {
                    if (err) throw err;
                    console.log('It\'s saved!');
                });
            }, function(e) {
                console.log(e);
            });
        } else {
            var buffer = context.createBuffer(data, false /*mixToMono*/);
            fs.writeFile(saveLocation, buffer, function (err) {
                if (err) throw err;
                console.log('It\'s saved!');
            });
        }
    }
    

    (Warning: untested code. If this doesn’t work, edits are welcome.)

    This effectively spools out decodeAudioData from the Web Audio API, decodes PCM from the supplied data, then attempts to save it to the target saveLocation. Simple enough, really.

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

Sidebar

Related Questions

Trying to save output from this script to a file based on a cell
So im trying to save the output from my subprocess.call but I keep getting
Using Mac OS X API, I'm trying to save a PDF file with a
I am trying to retrieve particular data from a txt file and would like
I am retrieving a jpg file from an oracle db, and trying to output
I am trying to save a file in Java in this way: PrintWriter output
I am trying to save data to a database on a button push, but
I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms
I'm trying to save a PDF file to SQL Server and I already have
I'm trying to save an excel spreadhseet from SQL Server Integration Services 2005. Unfortunatly

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.