Track#
- class ansys.sound.core.sound_composer.Track(name='', gain=0.0, source=None, filter=None)#
Sound Composer track class.
This class creates a track for the Sound Composer. A track is made of a source (including its source control) and an optional filter (which models the transfer from source to receiver).
A track allows the generation of the sound corresponding to the source, optionally filtered with the associated filter.
See also
SoundComposer,Filter,SourceSpectrum,SourceBroadbandNoise,SourceBroadbandNoiseTwoParameters,SourceHarmonics,SourceHarmonicsTwoParameters,SourceAudioExamples
Create a track with an audio source and a filter.
>>> from ansys.sound.core.sound_composer import Track >>> track_filter = Filter(sampling_frequency=48000.0) >>> track = Track( ... name="Sound Composer track", ... gain=-3.0, ... source=my_source, ... filter=my_filter ... )
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 parameters.
- Parameters:
- name
str, default: “” Name of the track.
- gain
float, default: 0.0 Gain to apply to the track’s generated sound, in dB.
- source
SourceSpectrum,SourceBroadbandNoise,SourceBroadbandNoiseTwoParameters,SourceHarmonics,SourceHarmonicsTwoParametersorSourceAudio, default:None Source of the track.
- filter
Filter, default:None Filter of the track.
- name
Methods
Get the track data as a generic data container.
Get the generated signal of the track as a DPF field.
Get the generated signal of the track, as a NumPy array.
Plot the resulting signal.
Track.process([sampling_frequency])Generate the signal of the track, using the source and filter currently set.
Set the track data from a generic data container.
Attributes
Filter object of the track.
Track gain in dB.
Name of the track.
Source object associated with the track.