#include <itpp/srccode/audiofile.h>
Inheritance diagram for itpp::SND_In_File:
Public Types | |
enum | data_encoding { enc_unknown = 0, enc_mulaw8 = 1, enc_alaw8 = 27, enc_linear8 = 2, enc_linear16 = 3, enc_linear24 = 4, enc_linear32 = 5, enc_float = 6, enc_double = 7 } |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! More... | |
Public Member Functions | |
SND_In_File () | |
Default constructor. | |
SND_In_File (const char *fname) | |
Open the file {fname}. | |
virtual | ~SND_In_File () |
Destructor. | |
virtual bool | open (const char *fname) |
Open the file {fname}. | |
virtual void | close () |
Close the file. | |
bool | seek_read (int pos) |
Go to sample number {pos}. | |
int | tell_read () |
Return the current sample position in the file. | |
virtual bool | read (vec &v) |
Read the whole file into the vector {v}. | |
virtual bool | read (vec &v, int n) |
Read {n} samples into the vector {v}. | |
bool | good () |
Returns true if everything is OK. | |
data_encoding | encoding () const |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! | |
int | channels () const |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! | |
int | samples () const |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! | |
int | rate () const |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! | |
void | set_rate (int r) |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!! | |
Protected Member Functions | |
int | sample_size () const |
ACTION: Add documentation for this protected member. | |
bool | read_header (std::istream &f) |
ACTION: Add documentation for this protected member. | |
bool | write_header (std::ostream &f) |
ACTION: Add documentation for this protected member. | |
Protected Attributes | |
std::fstream | file |
ACTION: Add documentation for this protected member. | |
bool | is_valid |
ACTION: Add documentation for this protected member. | |
struct { | |
unsigned magic | |
Magic number. | |
unsigned hdr_size | |
Size of this header. | |
unsigned data_size | |
Length of data (optional). | |
unsigned encoding | |
Data encoding format. | |
unsigned sample_rate | |
Samples per second. | |
unsigned channels | |
Number of interleaved channels. | |
char info [SND_INFO_LEN] | |
Info string. | |
} | header |
Definition of the header structure. |
ACTION: ADD DETAILED DOCUMENTATION FOR THIS CLASS!!!!!!!!!!!
Definition at line 141 of file audiofile.h.
enum itpp::SND_Format::data_encoding [inherited] |
itpp::SND_In_File::SND_In_File | ( | ) |
itpp::SND_In_File::SND_In_File | ( | const char * | fname | ) |
virtual itpp::SND_In_File::~SND_In_File | ( | ) | [inline, virtual] |
bool itpp::SND_In_File::open | ( | const char * | fname | ) | [virtual] |
Open the file {fname}.
Reimplemented in itpp::SND_IO_File.
Definition at line 276 of file audiofile.cpp.
References close(), itpp::Audio_File::file, itpp::Audio_File::is_valid, and itpp::SND_Format::read_header().
Referenced by SND_In_File(), and itpp::snd_read().
void itpp::SND_In_File::close | ( | ) | [virtual] |
Close the file.
Reimplemented in itpp::SND_IO_File.
Definition at line 294 of file audiofile.cpp.
References itpp::Audio_File::file, and itpp::Audio_File::is_valid.
Referenced by open(), and ~SND_In_File().
bool itpp::SND_In_File::seek_read | ( | int | pos | ) |
Go to sample number {pos}.
Definition at line 300 of file audiofile.cpp.
References itpp::Audio_File::file, itpp::SND_Format::header, and itpp::SND_Format::sample_size().
Referenced by itpp::SND_IO_File::open(), read(), and itpp::snd_read().
int itpp::SND_In_File::tell_read | ( | ) |
Return the current sample position in the file.
Definition at line 309 of file audiofile.cpp.
References itpp::Audio_File::file, itpp::Audio_File::good(), itpp::SND_Format::header, and itpp::SND_Format::sample_size().
bool itpp::SND_In_File::read | ( | vec & | v | ) | [virtual] |
Read the whole file into the vector {v}.
Definition at line 317 of file audiofile.cpp.
References itpp::Audio_File::file, itpp::Audio_File::good(), itpp::SND_Format::header, it_warning, itpp::SND_Format::samples(), and seek_read().
Referenced by itpp::snd_read().
bool itpp::SND_In_File::read | ( | vec & | v, | |
int | n | |||
) | [virtual] |
Read {n} samples into the vector {v}.
Definition at line 352 of file audiofile.cpp.
References itpp::Audio_File::file, itpp::Audio_File::good(), itpp::SND_Format::header, and it_warning.
bool itpp::Audio_File::good | ( | ) | [inline, inherited] |
Returns true if everything is OK.
Definition at line 67 of file audiofile.h.
References itpp::Audio_File::file, and itpp::Audio_File::is_valid.
Referenced by read(), itpp::SND_Out_File::seek_write(), tell_read(), itpp::SND_Out_File::tell_write(), and itpp::SND_Out_File::write().
data_encoding itpp::SND_Format::encoding | ( | ) | const [inline, inherited] |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 99 of file audiofile.h.
References itpp::SND_Format::header.
int itpp::SND_Format::channels | ( | ) | const [inline, inherited] |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 105 of file audiofile.h.
References itpp::SND_Format::header.
int itpp::SND_Format::samples | ( | ) | const [inline, inherited] |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 97 of file audiofile.h.
References itpp::SND_Format::header, and itpp::SND_Format::sample_size().
Referenced by read().
int itpp::SND_Format::rate | ( | ) | const [inline, inherited] |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 101 of file audiofile.h.
References itpp::SND_Format::header.
void itpp::SND_Format::set_rate | ( | int | r | ) | [inline, inherited] |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 103 of file audiofile.h.
References itpp::SND_Format::header.
int itpp::SND_Format::sample_size | ( | ) | const [protected, inherited] |
ACTION: Add documentation for this protected member.
Definition at line 208 of file audiofile.cpp.
References itpp::SND_Format::header.
Referenced by itpp::SND_Format::samples(), seek_read(), itpp::SND_Out_File::seek_write(), tell_read(), and itpp::SND_Out_File::tell_write().
bool itpp::SND_Format::read_header | ( | std::istream & | f | ) | [protected, inherited] |
ACTION: Add documentation for this protected member.
Definition at line 223 of file audiofile.cpp.
References itpp::SND_Format::header, and it_warning.
Referenced by itpp::SND_IO_File::open(), and open().
bool itpp::SND_Format::write_header | ( | std::ostream & | f | ) | [protected, inherited] |
ACTION: Add documentation for this protected member.
Definition at line 243 of file audiofile.cpp.
References itpp::SND_Format::header.
Referenced by itpp::SND_IO_File::close(), itpp::SND_Out_File::close(), and itpp::SND_Out_File::open().
std::fstream itpp::Audio_File::file [protected, inherited] |
ACTION: Add documentation for this protected member.
Definition at line 71 of file audiofile.h.
Referenced by itpp::SND_IO_File::close(), itpp::SND_Out_File::close(), close(), itpp::Audio_File::good(), itpp::SND_IO_File::open(), itpp::SND_Out_File::open(), open(), read(), seek_read(), itpp::SND_Out_File::seek_write(), tell_read(), itpp::SND_Out_File::tell_write(), and itpp::SND_Out_File::write().
bool itpp::Audio_File::is_valid [protected, inherited] |
ACTION: Add documentation for this protected member.
Definition at line 73 of file audiofile.h.
Referenced by itpp::Audio_File::Audio_File(), itpp::SND_IO_File::close(), itpp::SND_Out_File::close(), close(), itpp::Audio_File::good(), itpp::SND_IO_File::open(), itpp::SND_Out_File::open(), and open().
unsigned itpp::SND_Format::magic [protected, inherited] |
unsigned itpp::SND_Format::hdr_size [protected, inherited] |
unsigned itpp::SND_Format::data_size [protected, inherited] |
unsigned itpp::SND_Format::encoding [protected, inherited] |
unsigned itpp::SND_Format::sample_rate [protected, inherited] |
unsigned itpp::SND_Format::channels [protected, inherited] |
char itpp::SND_Format::info[SND_INFO_LEN] [protected, inherited] |
struct { ... } itpp::SND_Format::header [protected, inherited] |
Definition of the header structure.
Referenced by itpp::SND_Format::channels(), itpp::SND_Out_File::close(), itpp::SND_Format::encoding(), itpp::SND_Out_File::open(), itpp::SND_Format::rate(), read(), itpp::SND_Format::read_header(), itpp::SND_Format::sample_size(), itpp::SND_Format::samples(), seek_read(), itpp::SND_Out_File::seek_write(), itpp::SND_Format::set_rate(), tell_read(), itpp::SND_Out_File::tell_write(), itpp::SND_Out_File::write(), and itpp::SND_Format::write_header().
Generated on Thu Apr 19 14:43:50 2007 for IT++ by Doxygen 1.5.1