libvpb
4.2.58
|
![]() |
Classes | |
struct | VPB_VLOG |
Additional data that may be included in a wav file. More... | |
Macros | |
#define | VPB_VLOG_CHUNK 0x4000 |
May be added to the Wave file mode to include a VPB_VLOG chunk when recording. | |
Wave file output | |
void WINAPI | vpb_wave_open_write (WFILE **wav, const std::string &filename, int mode) |
Open a RIFF wave file for writing. More... | |
int WINAPI | vpb_wave_write (WFILE *wav, const char *buf, long n) |
Write a block of audio samples to a RIFF wave file. More... | |
void WINAPI | vpb_wave_close_write (WFILE *wav) |
Close a RIFF wave file after writing. More... | |
Wave file input | |
void WINAPI | vpb_wave_open_read (WFILE **wav, const std::string &filename) |
Open a RIFF wave file for reading. More... | |
int WINAPI | vpb_wave_read (WFILE *wav, char *buf, unsigned long n) |
Read a block of audio samples from a RIFF wave file. More... | |
void WINAPI | vpb_wave_close_read (WFILE *wav) |
Close a RIFF wave file after reading. More... | |
Miscellaneous wave file operations | |
size_t | vpb_wave_get_size (WFILE *wav) |
Return the size of wave file data in bytes. | |
AudioCompress WINAPI | vpb_wave_get_mode (WFILE *wav) |
Return the compression mode of wav. | |
void WINAPI | vpb_wave_set_sample_rate (WFILE *wav, unsigned short rate) |
Change the sample rate of a wav file. More... | |
int WINAPI | vpb_wave_seek (WFILE *wav, long offset) |
Move the wave pointer to a specified location in the samples. More... | |
Wave file VLOG data | |
int WINAPI | vpb_wave_set_vlog (WFILE *wav, VPB_VLOG *buf) |
Set VPB_VLOG information for inclusion in a wave file. More... | |
int WINAPI | vpb_wave_get_vlog (WFILE *wav, VPB_VLOG *buf) |
Get VPB_VLOG information from a wave file. More... | |
void WINAPI vpb_wave_close_read | ( | WFILE * | wav | ) |
Close a RIFF
wave file after reading.
wav | The pointer returned by a call to vpb_wave_open_read() . |
void WINAPI vpb_wave_close_write | ( | WFILE * | wav | ) |
Close a RIFF
wave file after writing.
wav | The pointer returned by a call to vpb_wave_open_write() . |
Get VPB_VLOG
information from a wave file.
wav | The pointer returned by a call to vpb_wave_open_* |
buf | A pointer to storage for the VPB_VLOG data. |
VPB_OK
if successful, else a non-zero error code. References VPB_VLOG::channel, VPB_VLOG::cidn, VPB_VLOG::cidt, VPB_VLOG::endtime, VPB_VLOG::filename, VPB_VLOG::inout, VPB_VLOG::statime, and VPB_VLOG::term.
void WINAPI vpb_wave_open_read | ( | WFILE ** | wav, |
const std::string & | filename | ||
) |
Open a RIFF
wave file for reading.
wav | Pointer to a pointer where encoding state may be stored. This pointer should be passed to other vpb_wave_* functions that will operate on the opened file. |
filename | The full path to the file to read. |
various | exceptions may be thrown in the event of an error. |
void WINAPI vpb_wave_open_write | ( | WFILE ** | wav, |
const std::string & | filename, | ||
int | mode | ||
) |
Open a RIFF
wave file for writing.
wav | Pointer to a pointer where encoding state may be stored. This pointer should be passed to other vpb_wave_* functions that will operate on the opened file. |
filename | The full path to the file to write. |
mode | The AudioCompress mode to use for the file. It may optionally be or'd with VPB_VLOG_CHUNK to record additional data in the wav file headers. |
various | exceptions may be thrown in the event of an error. |
References VPB_ALAW, VPB_LINEAR, VPB_MULAW, and VPB_VLOG_CHUNK.
int WINAPI vpb_wave_read | ( | WFILE * | wav, |
char * | buf, | ||
unsigned long | n | ||
) |
Read a block of audio samples from a RIFF
wave file.
wav | The pointer returned by a call to vpb_wave_open_read() . |
buf | The buffer to store samples in. |
n | The size of the buffer in bytes. |
int WINAPI vpb_wave_seek | ( | WFILE * | wav, |
long | offset | ||
) |
Move the wave pointer to a specified location in the samples.
wav | The pointer returned by a call to vpb_wave_open_* . |
offset | The offset from the start of the audio samples. |
VPB_OK
if the operation succeeded. Otherwise -1
will be returned and errno
will be set to indicate the error. void WINAPI vpb_wave_set_sample_rate | ( | WFILE * | wav, |
unsigned short | rate | ||
) |
Change the sample rate of a wav file.
wav | The pointer returned by a call to vpb_wave_open_* . |
rate | The new sampling rate to use. |
Set VPB_VLOG
information for inclusion in a wave file.
wav | The pointer returned by a call to vpb_wave_open_write() . |
buf | The VPB_VLOG data to include. |
VPB_OK
if successful, else a non-zero error code. References VPB_VLOG::channel, VPB_VLOG::cidn, VPB_VLOG::cidt, VPB_VLOG::endtime, VPB_VLOG::filename, VPB_VLOG::inout, VPB_VLOG::statime, and VPB_VLOG::term.
int WINAPI vpb_wave_write | ( | WFILE * | wav, |
const char * | buf, | ||
long | n | ||
) |
Write a block of audio samples to a RIFF
wave file.
wav | The pointer returned by a call to vpb_wave_open_write() . |
buf | The buffer of samples to write. |
n | The number of bytes to write. |