A class for doing both input and output of audio samples. More...
#include <itpp/srccode/audiofile.h>
Public Member Functions | |
SND_IO_File () | |
Constructor - creates uninitialized stream. | |
SND_IO_File (const char *fname) | |
Open the file fname, check file header. | |
SND_IO_File (const char *fname, const Audio_Stream_Description &d) | |
Open the file fname, truncate and overwrite header with description d. | |
~SND_IO_File () | |
Stream destructor. | |
bool | open (const char *fname) |
Open the file fname, check file header. | |
bool | open (const char *fname, const Audio_Stream_Description &d) |
Open the file fname, truncate and overwrite header with description d. | |
void | close () |
Close the file. | |
Audio_Stream_Description | get_description () const |
Get stream description. | |
bool | seek_read (std::streamoff pos) |
Set current position to read from pos (samples). | |
std::streamoff | tell_read () |
Get current position to read from in samples. | |
bool | seek_write (std::streamoff pos) |
Set current position to write to pos (samples). | |
std::streamoff | tell_write () |
Get current position to write in samples. | |
std::streamoff | num_samples () const |
Get number of samples in stream. | |
bool | read_sample (double &s, int ch=0) |
Read single sample s at current position to channel ch. | |
vec | read_channel (int n, int ch=0) |
Read n samples from channel ch starting at current position. | |
mat | read (int n) |
Read n samples from all channels starting at current position. | |
bool | write_sample (const double &s, int ch=0) |
Write single sample s at current position to channel ch. | |
bool | write_channel (const vec &v, int ch=0) |
Write the vector v to channel ch starting at current position. | |
bool | write (const mat &m) |
Write audio channels from columns of the matrix m starting at current position. | |
A class for doing both input and output of audio samples.
SND_IO_File provides facilities for doing both input and output of audio samples.
Definition at line 374 of file audiofile.h.
|
inline |
Get stream description.
Definition at line 392 of file audiofile.h.
|
inline |
Set current position to read from pos (samples).
Definition at line 394 of file audiofile.h.
|
inline |
Get current position to read from in samples.
Definition at line 405 of file audiofile.h.
|
inline |
Set current position to write to pos (samples).
Definition at line 413 of file audiofile.h.
|
inline |
Get current position to write in samples.
Definition at line 424 of file audiofile.h.
|
inline |
Get number of samples in stream.
Definition at line 432 of file audiofile.h.
Read single sample s at current position to channel ch.
Definition at line 434 of file audiofile.h.
Read n samples from channel ch starting at current position.
Definition at line 442 of file audiofile.h.
|
inline |
Read n samples from all channels starting at current position.
Definition at line 450 of file audiofile.h.
Write single sample s at current position to channel ch.
Definition at line 459 of file audiofile.h.
Write the vector v to channel ch starting at current position.
Definition at line 472 of file audiofile.h.
Write audio channels from columns of the matrix m starting at current position.
Definition at line 485 of file audiofile.h.
Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.8