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 is simply made of a sound signal, that is, sound samples over time, in Pa, that is meant to be played, as is (unless resampling is necessary), along with other Sound Composer sources. The audio source can be loaded from a WAV file or a text file.

Class instantiation takes the following parameters.

Parameters:
filestr, default: “”

Path to the audio file (WAV format or text format with header AnsysSound_SoundSamples).

Methods

SourceAudio.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

SourceAudio.get_output()

Get the generated sound as a DPF field.

SourceAudio.get_output_as_nparray()

Get the generated sound as a NumPy array.

SourceAudio.is_source_control_valid()

Check if the source control is valid.

SourceAudio.load_from_text_file(file)

Load the audio source data from a text file.

SourceAudio.load_from_wave_file(file)

Load the audio source data from a WAV file.

SourceAudio.plot()

Plot the generated sound in a figure.

SourceAudio.plot_control()

Plot the source control(s) in a figure.

SourceAudio.process([sampling_frequency])

Generate the sound of the audio source.

Attributes

SourceAudio.source_audio_data

Audio source data, as a DPF field.