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_source
str
, default: “” Path to the spectrum file.
- source_control
SourceControlSpectrum
, default:None
Source control to use when generating the sound from this source.
- file_source
Methods
Convert a DPF fields container to a NumPy array.
Get the generated sound as a DPF field.
Get the generated sound as a NumPy array.
Source control verification function.
SourceSpectrum.load_source_spectrum
(file_source)Load the spectrum source data from a spectrum file.
Plot the resulting signal in a figure.
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
Spectrum source control object.
Spectrum source data, as a DPF field.