SourceSpectrum#

class ansys.sound.core.sound_composer.SourceSpectrum(file_source='', source_control=None)#

Sound Composer’s spectrum source class.

This class creates a spectrum source for the Sound Composer. A spectrum source is used to generate a sound signal from a given spectrum and its source control. The source control contains the duration of the sound and the method used to generate it.

Class instantiation takes the following parameters.

Parameters:
file_sourcestr, default: “”

Path to the spectrum file.

source_controlSourceControlSpectrum, default: None

Source control to use when generating the sound from this source.

Methods

SourceSpectrum.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

SourceSpectrum.get_output()

Get the generated sound as a DPF field.

SourceSpectrum.get_output_as_nparray()

Get the generated sound as a NumPy array.

SourceSpectrum.is_source_control_valid()

Source control verification function.

SourceSpectrum.load_source_spectrum(file_source)

Load the spectrum source data from a spectrum file.

SourceSpectrum.plot()

Plot the resulting signal in a figure.

SourceSpectrum.plot_control()

Plot the source control(s) in a figure.

SourceSpectrum.process([sampling_frequency])

Generate the sound of the spectrum source, using the current spectrum and source control.

Attributes

SourceSpectrum.source_control

Spectrum source control object.

SourceSpectrum.source_spectrum_data

Spectrum source data, as a DPF field.