libvisual
0.5.0
|
Multi-channel audio stream class. More...
#include <libvisual/lv_audio.h>
Public Member Functions | |
Audio () | |
Default constructor. | |
Audio (Audio const &)=delete | |
Audio (Audio &&rhs) | |
Move constructor. | |
~Audio () | |
Destructor. | |
Audio & | operator= (Audio const &)=delete |
Audio & | operator= (Audio &&rhs) |
Move assignment operator. | |
bool | get_sample (BufferPtr const &buffer, std::string const &channel_name) |
Retrieves samples from a channel. More... | |
void | get_sample_mixed_simple (BufferPtr const &buffer, unsigned int channels,...) |
Returns samples downmixed by averaging a set of channels. More... | |
void | get_sample_mixed_simple (BufferPtr const &buffer, unsigned int channels, va_list args) |
void | get_sample_mixed (BufferPtr const &buffer, bool divide, unsigned int channels,...) |
Returns samples downmixed by weighted summing or averaging a set of channels. More... | |
void | get_sample_mixed (BufferPtr const &buffer, bool divide, unsigned int channels, va_list args) |
void | get_spectrum (BufferPtr const &buffer, std::size_t sample_count, std::string const &channel_name, bool normalised) |
Returns the amplitude spectrum of a set of samples from a channel. More... | |
void | get_spectrum (BufferPtr const &buffer, std::size_t sample_count, std::string const &channel_name, bool normalised, float multiplier) |
void | input (BufferPtr const &buffer, VisAudioSampleRateType rate, VisAudioSampleFormatType format, VisAudioSampleChannelType channel_type) |
Adds an interleaved set of samples to the stream. More... | |
void | input (BufferPtr const &buffer, VisAudioSampleRateType rate, VisAudioSampleFormatType format, std::string const &channel_name) |
Adds a set of channel samples to the stream. More... | |
Static Public Member Functions | |
static void | get_spectrum_for_sample (BufferPtr const &buffer, BufferConstPtr const &samples, bool normalised) |
Returns the amplitude spectrum of a set of samples. More... | |
static void | get_spectrum_for_sample (BufferPtr const &buffer, BufferConstPtr const &samples, bool normalised, float multiplier) |
static void | normalise_spectrum (BufferPtr const &buffer) |
Multi-channel audio stream class.
Definition at line 79 of file lv_audio.h.
bool LV::Audio::get_sample | ( | BufferPtr const & | buffer, |
std::string const & | channel_name | ||
) |
Retrieves samples from a channel.
[out] | buffer | buffer to hold the retrieved samples (32-bit floating point PCM) |
channel_name | name of channel |
Definition at line 143 of file lv_audio.cpp.
Referenced by get_spectrum().
void LV::Audio::get_sample_mixed | ( | BufferPtr const & | buffer, |
bool | divide, | ||
unsigned int | channels, | ||
... | |||
) |
Returns samples downmixed by weighted summing or averaging a set of channels.
[out] | buffer | buffer to hold the mixed samples (32-bit floating point PCM) |
divide | perform averaging | |
channels | number of channels | |
... | list of channel names (each of type const char *), followed by a list of respective weights (each of type double) |
Definition at line 188 of file lv_audio.cpp.
void LV::Audio::get_sample_mixed_simple | ( | BufferPtr const & | buffer, |
unsigned int | channels, | ||
... | |||
) |
Returns samples downmixed by averaging a set of channels.
[out] | buffer | buffer to hold the mixed samples (32-bit floating point PCM) |
channels | number of channels | |
... | list of channel names (each of type const char *) |
Definition at line 157 of file lv_audio.cpp.
void LV::Audio::get_spectrum | ( | BufferPtr const & | buffer, |
std::size_t | sample_count, | ||
std::string const & | channel_name, | ||
bool | normalised | ||
) |
Returns the amplitude spectrum of a set of samples from a channel.
[out] | buffer | buffer to hold the amplitude spectrum (32-bit floats) |
sample_count | number of samples to draw from channel | |
channel_name | name of channel | |
normalised | normalise ampltitudes to [0.0, 1.0] |
Definition at line 223 of file lv_audio.cpp.
|
static |
Returns the amplitude spectrum of a set of samples.
[out] | buffer | buffer to hold the ampltitude spectrum (32-bit floats) |
samples | input samples | |
normalised | normalise ampltitudes to [0.0, 1.0] |
Definition at line 243 of file lv_audio.cpp.
Referenced by get_spectrum().
void LV::Audio::input | ( | BufferPtr const & | buffer, |
VisAudioSampleRateType | rate, | ||
VisAudioSampleFormatType | format, | ||
VisAudioSampleChannelType | channel_type | ||
) |
Adds an interleaved set of samples to the stream.
buffer | buffer containing the input samples |
rate | sampling rate |
format | sample format |
channel_type | channel format |
Definition at line 273 of file lv_audio.cpp.
void LV::Audio::input | ( | BufferPtr const & | buffer, |
VisAudioSampleRateType | rate, | ||
VisAudioSampleFormatType | format, | ||
std::string const & | channel_name | ||
) |
Adds a set of channel samples to the stream.
buffer | buffer containing the input samples |
rate | sampling rate |
format | sample format |
channel_name | name of channel |
Definition at line 308 of file lv_audio.cpp.