SourceAudio#
- class ansys.sound.core.sound_composer.SourceAudio(file='')#
Sound Composer’s audio source class.
This class creates an audio source for the Sound Composer. An audio source simply consists of a time-domain - typically audio - signal. Unlike other source types, it requires no source control.
See also
Examples
Create an audio source from a sound signal stored in a WAV file.
>>> from ansys.sound.core.sound_composer import SourceAudio >>> source_audio = SourceAudio(file="path/to/audio.wav") >>> source_audio.process(sampling_frequency=48000.0) >>> source_audio.plot()
Class instantiation takes the following parameters.
- Parameters:
- file
str, default: “” Path to the audio source file. Supported files are WAV files and and text files with the header AnsysSound_SoundSamples.
- file
Methods
Get the source data as generic data containers.
Get the generated sound as a DPF field.
Get the generated sound as a NumPy array.
Check if the source control is valid.
Load the audio source data from a text file.
Load the audio source data from a WAV file.
Plot the generated sound.
Plot the source control(s) in a figure.
SourceAudio.process([sampling_frequency])Generate the sound of the audio source.
Set the source and source control data from generic data containers.
Attributes
Source data of the audio source.