#include <itpp/srccode/audiofile.h>
Inheritance diagram for itpp::SND_IO_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_IO_File () | |
Constructor. | |
SND_IO_File (const char *fname) | |
Open the file {fname}. | |
virtual | ~SND_IO_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!!!!!!!!!!! | |
bool | open (const char *fname, int rate=8000, data_encoding e=enc_linear16) |
Open the file {fname}. | |
bool | seek_write (int pos) |
Go to sample number {pos}. | |
int | tell_write () |
Return the current sample position in the file. | |
virtual bool | write (const vec &v) |
Write the vector {v}. | |
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 205 of file audiofile.h.
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 85 of file audiofile.h. |
|
Constructor.
Definition at line 208 of file audiofile.h. |
|
Open the file {fname}.
Definition at line 210 of file audiofile.h. |
|
Destructor.
Definition at line 212 of file audiofile.h. |
|
Open the file {fname}.
Reimplemented from itpp::SND_In_File. Definition at line 486 of file audiofile.cpp. References itpp::Vec< Num_T >::clear(), close(), itpp::SND_Format::read_header(), itpp::SND_In_File::seek_read(), and itpp::SND_Out_File::seek_write(). |
|
Close the file.
Reimplemented from itpp::SND_In_File. Definition at line 510 of file audiofile.cpp. References itpp::SND_Format::write_header(). Referenced by open(). |
|
Go to sample number {pos}.
Definition at line 300 of file audiofile.cpp. Referenced by open(), and itpp::SND_In_File::read(). |
|
Return the current sample position in the file.
Definition at line 309 of file audiofile.cpp. References itpp::Audio_File::good(), and itpp::SND_Format::sample_size(). |
|
Read the whole file into the vector {v}.
Definition at line 317 of file audiofile.cpp. References itpp::Audio_File::good(), it_warning, itpp::SND_Format::samples(), itpp::SND_In_File::seek_read(), and itpp::Vec< Num_T >::set_size(). |
|
Read {n} samples into the vector {v}.
Definition at line 352 of file audiofile.cpp. References itpp::Audio_File::good(), it_warning, and itpp::Vec< Num_T >::set_size(). |
|
Returns true if everything is OK.
Definition at line 67 of file audiofile.h. Referenced by itpp::SND_In_File::read(), itpp::SND_Out_File::seek_write(), itpp::SND_In_File::tell_read(), itpp::SND_Out_File::tell_write(), and itpp::SND_Out_File::write(). |
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 99 of file audiofile.h. |
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 105 of file audiofile.h. |
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 97 of file audiofile.h. Referenced by itpp::SND_In_File::read(). |
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 101 of file audiofile.h. |
|
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!
Definition at line 103 of file audiofile.h. |
|
ACTION: Add documentation for this protected member.
Definition at line 208 of file audiofile.cpp. References itpp::SND_Format::header. Referenced by itpp::SND_In_File::tell_read(), and itpp::SND_Out_File::tell_write(). |
|
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 open(), and itpp::SND_In_File::open(). |
|
ACTION: Add documentation for this protected member.
Definition at line 243 of file audiofile.cpp. References itpp::SND_Format::header. Referenced by close(), itpp::SND_Out_File::close(), and itpp::SND_Out_File::open(). |
|
Open the file {fname}.
Definition at line 398 of file audiofile.cpp. References itpp::Vec< Num_T >::clear(), itpp::SND_Out_File::close(), and itpp::SND_Format::write_header(). Referenced by itpp::SND_Out_File::SND_Out_File(). |
|
Go to sample number {pos}.
Definition at line 429 of file audiofile.cpp. References itpp::Audio_File::good(). Referenced by open(). |
|
Return the current sample position in the file.
Definition at line 441 of file audiofile.cpp. References itpp::Audio_File::good(), and itpp::SND_Format::sample_size(). |
|
Write the vector {v}.
Definition at line 449 of file audiofile.cpp. References itpp::Audio_File::good(), it_warning, and itpp::Vec< Num_T >::size(). |
|
ACTION: Add documentation for this protected member.
Definition at line 71 of file audiofile.h. |
|
ACTION: Add documentation for this protected member.
Definition at line 73 of file audiofile.h. Referenced by itpp::Audio_File::Audio_File(). |
|
Magic number.
Definition at line 112 of file audiofile.h. |
|
Size of this header.
Definition at line 114 of file audiofile.h. |
|
Length of data (optional).
Definition at line 116 of file audiofile.h. |
|
Data encoding format.
Definition at line 118 of file audiofile.h. |
|
Samples per second.
Definition at line 120 of file audiofile.h. |
|
Number of interleaved channels.
Definition at line 122 of file audiofile.h. |
|
Info string.
Definition at line 124 of file audiofile.h. |
|
Definition of the header structure.
Referenced by itpp::SND_Format::read_header(), itpp::SND_Format::sample_size(), and itpp::SND_Format::write_header(). |
Generated on Fri Jan 11 08:51:43 2008 for IT++ by Doxygen 1.3.9.1