.. / Hz.Builtins / Hz.AudioFileOut

Hz.ADC . Hz.DAC
Hz.StreamIn . Hz.AudioFileOut . Hz.Scope
Hz.ModLFO . Hz.ModRand . Hz.ModEnv . Hz.ModExpr
see also Hz.Plugins, Hz.Builtins Examples


Here we explore the audio file creation capability of the Hz.AudioFileOut builtin.

Overview

Hz.AudioFileOut is a builtin anode that asynchronously streams its input audio stream to a stereo .WAV file.

The idea is simple:

  1. create an instance of Hz.AudioFileOut
  2. chain the output of a node to its input. You can record individual voices or the entire scene. Below, by chaining dac to record we'll record the entire scene.

Usage

if(doRecord)
{
    // this will fail if your workspace doesn't have a directory
    // named '_tmp'.  You can create one via the workspace panel.
    let ts = Util.GetFileTimestamp();
    let outputFile = await ResolveWSFile(`_ws_/_tmp/radio.${ts}.wav`, false);
    let preset = {filename: outputFile};
    let record = ascene.NewAnode("Hz.AudioFileOut", {preset});
    console.log("Recording to " + outputFile + "   <----------------");

    let dac = ascene.GetDAC();
    ascene.Chain(dac, record);
}

Example

Radio example

home .. topics .. interface .. reference .. examples .. tipjar