#include <audio_chunk.h>

Public Member Functions | |
| audio_chunk_temp_impl (const audio_sample *p_data, t_size p_samples, t_uint32 p_sample_rate, t_uint32 p_channels, t_uint32 p_channel_config) | |
| audio_sample * | get_data () |
| const audio_sample * | get_data () const |
| t_size | get_data_size () const |
| Retrieves size of allocated buffer space, in audio_samples. | |
| void | set_data_size (t_size p_new_size) |
| Resizes audio data buffer to specified size. Throws std::bad_alloc on failure. | |
| unsigned | get_srate () const |
| Retrieves sample rate of contained audio data. | |
| void | set_srate (unsigned val) |
| Sets sample rate of contained audio data. | |
| unsigned | get_channels () const |
| Retrieves channel count of contained audio data. | |
| unsigned | get_channel_config () const |
| Retrieves channel map of contained audio data. Conditions where number of channels specified by channel map don't match get_channels() return value should not be possible. | |
| void | set_channels (unsigned p_count, unsigned p_config) |
| Sets channel count / channel map. | |
| t_size | get_sample_count () const |
| void | set_sample_count (t_size val) |
| Sets number of valid samples in the buffer. WARNING: sample count * channel count should never be above allocated buffer size. | |
| audio_chunk_temp_impl::audio_chunk_temp_impl | ( | const audio_sample * | p_data, | |
| t_size | p_samples, | |||
| t_uint32 | p_sample_rate, | |||
| t_uint32 | p_channels, | |||
| t_uint32 | p_channel_config | |||
| ) | [inline] |
| audio_sample* audio_chunk_temp_impl::get_data | ( | ) | [inline, virtual] |
Retrieves audio data buffer pointer (non-const version). Returned pointer is for temporary use only; it is valid until next set_data_size call, or until the object is destroyed.
Size of returned buffer is equal to get_data_size() return value (in audio_samples). Amount of actual data may be smaller, depending on sample count and channel count. Conditions where sample count * channel count are greater than data size should not be possible.
Implements audio_chunk.
| const audio_sample* audio_chunk_temp_impl::get_data | ( | ) | const [inline, virtual] |
Retrieves audio data buffer pointer (const version). Returned pointer is for temporary use only; it is valid until next set_data_size call, or until the object is destroyed.
Size of returned buffer is equal to get_data_size() return value (in audio_samples). Amount of actual data may be smaller, depending on sample count and channel count. Conditions where sample count * channel count are greater than data size should not be possible.
Implements audio_chunk.
| t_size audio_chunk_temp_impl::get_data_size | ( | ) | const [inline, virtual] |
| void audio_chunk_temp_impl::set_data_size | ( | t_size | p_new_size | ) | [inline, virtual] |
Resizes audio data buffer to specified size. Throws std::bad_alloc on failure.
Implements audio_chunk.
| unsigned audio_chunk_temp_impl::get_srate | ( | ) | const [inline, virtual] |
| void audio_chunk_temp_impl::set_srate | ( | unsigned | val | ) | [inline, virtual] |
| unsigned audio_chunk_temp_impl::get_channels | ( | ) | const [inline, virtual] |
| unsigned audio_chunk_temp_impl::get_channel_config | ( | ) | const [inline, virtual] |
Retrieves channel map of contained audio data. Conditions where number of channels specified by channel map don't match get_channels() return value should not be possible.
Implements audio_chunk.
| void audio_chunk_temp_impl::set_channels | ( | unsigned | p_count, | |
| unsigned | p_config | |||
| ) | [inline, virtual] |
| t_size audio_chunk_temp_impl::get_sample_count | ( | ) | const [inline, virtual] |
Retrieves number of valid samples in the buffer.
Note that a "sample" means a unit of interleaved PCM data representing states of each channel at given point of time, not a single PCM value.
For an example, duration of contained audio data is equal to sample count / sample rate, while actual size of contained data is equal to sample count * channel count.
Implements audio_chunk.
| void audio_chunk_temp_impl::set_sample_count | ( | t_size | val | ) | [inline, virtual] |
Sets number of valid samples in the buffer. WARNING: sample count * channel count should never be above allocated buffer size.
Implements audio_chunk.
1.5.5