#include <Audio.hxx>
You can also get 'slices' that's an audio that maps to some other audio's data.
Definition at line 48 of file Audio.hxx.
Public Member Functions | |
DYNAMIC_TYPE_USING_INTERFACE (Audio, 3, ProcessingData) | |
DYN_ATTRIBUTE (0, public, TData, SampleRate) | |
Sample rate in Hz. | |
DYN_ATTRIBUTE (1, public, TTime, BeginTime) | |
Temporal Tags for audio chunk in miliseconds. | |
DYN_ATTRIBUTE (2, public, DataArray, Buffer) | |
The Audio buffer. | |
int | GetSize () const |
TTime | GetEndTime () const |
Getter for the end time in miliseconds. | |
TTime | GetDuration () const |
Method for getting the total duration of Buffer. | |
void | SetSize (int s) |
Resizes the array buffers to a size in samples. | |
void | SetEndTime (TTime time) |
void | ResizeToEndTime (TTime time) |
Resizes the array buffer to last from the begin time until the specified time position (time in miliseconds). | |
void | SetDuration (TTime duration) |
void | ResizeToDuration (TTime duration) |
Resizes the array buffer to last the specified time duration (miliseconds). | |
void | GetAudioChunk (TTime beginTime, TTime endTime, Audio &chunk, bool configureChunk=true) const |
Method for copying an audio chunk out of the existing data. | |
void | GetAudioChunk (TIndex beginIndex, TIndex endIndex, Audio &chunk, bool configureChunk=true) const |
Method for copying an audio chunk out of the existing data. | |
void | GetAudioSlice (TTime beginTime, TTime endTime, Audio &slice, bool configureSlice=true) const |
Method for copying an audio "slice" out of the existing data. | |
void | GetAudioSlice (TIndex beginIndex, TIndex endIndex, Audio &slice, bool configureSlice=true) const |
Method for getting an audio "slice" out of the existing data. | |
void | SetAudioChunk (TTime beginTime, const Audio &chunk) |
Method for setting an audio chunk of the audio out of an existing chunk. | |
void | SetAudioChunk (TIndex beginIndex, const Audio &chunk) |
Method for setting an audio chunk of the audio out of an existing chunk. | |
Protected Member Functions | |
void | DefaultInit () |
The concrete dynamic type constructor calls DefaultInit(). |
CLAM::Audio::DYNAMIC_TYPE_USING_INTERFACE | ( | Audio | , | |
3 | , | |||
ProcessingData | ||||
) |
CLAM::Audio::DYN_ATTRIBUTE | ( | 0 | , | |
public | , | |||
TData | , | |||
SampleRate | ||||
) |
Sample rate in Hz.
CLAM::Audio::DYN_ATTRIBUTE | ( | 1 | , | |
public | , | |||
TTime | , | |||
BeginTime | ||||
) |
Temporal Tags for audio chunk in miliseconds.
void Audio::DefaultInit | ( | void | ) | [protected] |
The concrete dynamic type constructor calls DefaultInit().
This allows user to initialize his/her object. But we define DefaultInit() here because we don't want to force writting one DefaultInit() function for each concrete dynamic type. If a dynamic type concrete class defines some (not-default) constructors, this should also call the DefaultInit().
Reimplemented from CLAM::DynamicType.
Definition at line 36 of file Audio.cxx.
References CLAM::DynamicType::UpdateData().
int CLAM::Audio::GetSize | ( | ) | const [inline] |
Definition at line 67 of file Audio.hxx.
Referenced by CLAM::BinaryAudioOp< CLAM::Multiply< float > >::Check(), CLAM::FFT_base::CheckTypes(), CLAM::SpectralAnalysis::Do(), CLAM::SMSSynthesis::Do(), CLAM::SinusoidalSynthesis::Do(), CLAM::SimpleOscillator::Do(), CLAM::OverlapAdd::Do(), CLAM::Oscillator::Do(), CLAM::Normalization::Do(), CLAM::MonoAudioFileWriter::Do(), CLAM::MonoAudioFileReader::Do(), CLAM::LPC_AutoCorrelation::Do(), CLAM::IFFT_fftw3::Do(), CLAM::EnvelopeModulator::Do(), CLAM::EnvelopeExtractor::Do(), CLAM::BinaryAudioOp< CLAM::Multiply< float > >::Do(), CLAM::AudioWindowing::Do(), CLAM::AudioFileMemoryLoader::Do(), CLAM::AudioAmplifier::Do(), CLAM::ADSR::Do(), GetAudioChunk(), GetAudioSlice(), GetDuration(), GetEndTime(), CLAM::AudioFileMemoryLoader::GetSamples(), CLAM::RtAAudioDevice::Read(), SetAudioChunk(), SetSize(), and CLAM::RtAAudioDevice::Write().
TTime CLAM::Audio::GetEndTime | ( | ) | const [inline] |
TTime CLAM::Audio::GetDuration | ( | ) | const [inline] |
void Audio::SetSize | ( | int | s | ) |
Resizes the array buffers to a size in samples.
Increases or shrinks by the end of the buffer preserving the data. If size increases, new samples are set to 0.
s | The new size in samples |
Definition at line 61 of file Audio.cxx.
References CLAM_ASSERT, and GetSize().
Referenced by CLAM::AudioFileMemoryLoader::ConcreteConfigure(), CLAM::SpectralAnalysis::Do(), CLAM::AudioWindowing::Do(), GetAudioChunk(), GetAudioSlice(), ResizeToDuration(), and ResizeToEndTime().
void Audio::SetEndTime | ( | TTime | time | ) |
Definition at line 49 of file Audio.cxx.
References CLAM_WARNING, and ResizeToEndTime().
void Audio::ResizeToEndTime | ( | TTime | time | ) |
Resizes the array buffer to last from the begin time until the specified time position (time in miliseconds).
time | End time of the buffer once resized |
Definition at line 55 of file Audio.cxx.
References Round(), and SetSize().
Referenced by SetEndTime().
void Audio::SetDuration | ( | TTime | duration | ) |
Definition at line 75 of file Audio.cxx.
References CLAM_WARNING, and ResizeToDuration().
void Audio::ResizeToDuration | ( | TTime | duration | ) |
Resizes the array buffer to last the specified time duration (miliseconds).
duration | The required duration for the buffer once resized |
Definition at line 81 of file Audio.cxx.
References SetSize().
Referenced by SetDuration().
void Audio::GetAudioChunk | ( | TTime | beginTime, | |
TTime | endTime, | |||
Audio & | chunk, | |||
bool | configureChunk = true | |||
) | const |
Method for copying an audio chunk out of the existing data.
Time in milliseconds.
beginTime | Beginning of the chunk in time measure. | |
endTime | Ending of the chunk in time measure. | |
chunk | The Audio data chunk | |
configureChunk | Optional parameter to set the configuration of the chunk. True by default. |
Definition at line 96 of file Audio.cxx.
Referenced by CLAM::SpectralSynthesis::Do(), CLAM::SpectralAnalysis::Do(), and CLAM::AudioWindowing::Do().
void Audio::GetAudioChunk | ( | TIndex | beginIndex, | |
TIndex | endIndex, | |||
Audio & | chunk, | |||
bool | configureChunk = true | |||
) | const |
Method for copying an audio chunk out of the existing data.
beginIndex | Beginning of the chunk inside the Buffer. | |
endIndex | Ending of the chunk inside the Buffer | |
chunk | The Audio data chunk | |
configureChunk | Optional parameter to set the configuration of the chunk. True by default. |
Definition at line 131 of file Audio.cxx.
References CLAM_ASSERT, GetSize(), and SetSize().
void Audio::GetAudioSlice | ( | TTime | beginTime, | |
TTime | endTime, | |||
Audio & | slice, | |||
bool | configureSlice = true | |||
) | const |
Method for copying an audio "slice" out of the existing data.
The difference between slices Time in miliseconds. and chunks is that slices don't own any memory.
beginTime | Beginning of the chunk in time measure. | |
endTime | Ending of the chunk in time measure. | |
slice | The Audio data slice | |
configureSlice | Optional parameter to set the configuration of the slice. True by default. |
void Audio::GetAudioSlice | ( | TIndex | beginIndex, | |
TIndex | endIndex, | |||
Audio & | slice, | |||
bool | configureSlice = true | |||
) | const |
Method for getting an audio "slice" out of the existing data.
The difference between slices and chunks is that slices don't own any memory.
beginIndex | Beginning of the chunk inside the Buffer. | |
endIndex | Ending of the chunk inside the Buffer | |
slice | The Audio slice | |
configureSlice | Optional parameter to set the configuration of the slice. True by default. |
Definition at line 108 of file Audio.cxx.
References CLAM_ASSERT, GetSize(), and SetSize().
Method for setting an audio chunk of the audio out of an existing chunk.
beginIndex | Beginning location of the chunk in the Buffer. | |
chunk | The Audio data chunk to insert |
Definition at line 195 of file Audio.cxx.
References CLAM_ASSERT, and GetSize().