IT++ Logo
Public Member Functions | List of all members
itpp::SND_IO_File Class Reference

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.
 

Detailed Description

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.


The documentation for this class was generated from the following file:
SourceForge Logo

Generated on Sat May 25 2013 16:32:34 for IT++ by Doxygen 1.8.2