Skip to main content
The SoundStage is the central manager for your project. It collects Speaker instances, handles the Ambisonic encoding (Spherical Harmonics), and renders the final output.
from ambisonicPy import SoundStage
myStage = SoundStage(output_format='binaural', ambi_order=1)

Parameters

output_format
string
default:"binaural"
The rendering mode.
  • 'binaural': Decodes to stereo using HRIRs (Head-Related Impulse Responses) for headphone listening.
  • 'ambisonic': Exports raw B-format/Ambisonic channels.
ambi_order
int
default:"1"
The Ambisonic order. Higher orders provide better spatial resolution but require more processing power.

Methods

add_speaker

Adds a speaker to the scene.
stage.add_speaker(speaker)
All speakers added to a stage must share the same sample rate.

render

Processes all effects, encodes spatial data, and writes the final audio file.
stage.render(output_path="soundstage.wav", sofa_path=None)
output_path
string
default:"soundstage.wav"
The file path where the rendered audio (.wav) will be saved.
sofa_path
string
default:"None"
Optional path to a custom .sofa file (HRTF dataset). If None, a default dataset is used based on the sample rate.

Example Usage

stage = SoundStage(output_format='binaural', ambi_order=1)
stage.add_speaker(my_speaker)
stage.render("output.wav")