SoundComposer#

class ansys.sound.core.sound_composer.SoundComposer(project_path='')#

Sound Composer project class.

This class creates a Sound Composer project. A project is made of several tracks (Track), each containing a source, to generate the sound, and an optional filter, to model the transfer between the source and the receiver.

See also

Track

Examples

Load a Sound Composer project created in Ansys Sound SAS, and plot the generated signal.

>>> from ansys.sound.core.sound_composer import SoundComposer
>>> sound_composer = SoundComposer(project_path="path/to/project.scn")
>>> sound_composer.process(sampling_frequency=48000.0)
>>> sound_composer.plot()

See also

Use an existing Sound Composer project file

Example demonstrating how to load and work with an existing Sound Composer project.

Create a Sound Composer project

Example demonstrating how to create a Sound Composer project from scratch.

Class instantiation takes the following parameter.

Parameters:
project_pathstr, default: “”

Path to the Sound Composer project file to load (.scn).

Methods

SoundComposer.add_track(track)

Add a track to the project.

SoundComposer.get_output()

Get the generated signal of the Sound Composer project as a DPF field.

SoundComposer.get_output_as_nparray()

Get the generated signal of the Sound Composer project as a NumPy array.

SoundComposer.load(project_path)

Load a Sound Composer project.

SoundComposer.plot()

Plot the generated signal of the Sound Composer project.

SoundComposer.process([sampling_frequency])

Generate the signal of the current Sound Composer project.

SoundComposer.save(project_path)

Save the Sound Composer project.

Attributes

SoundComposer.name

Name of the Sound Composer project.

SoundComposer.tracks

List of tracks.