IT++ Logo Newcom Logo

itpp::SND_Out_File Class Reference
[Audio]

A class to write SND-files (the .au format)

ACTION: ADD DETAILED DOCUMENTATION FOR THIS CLASS!!!!!!!!!!! More...

#include <itpp/srccode/audiofile.h>

Inheritance diagram for itpp::SND_Out_File:

itpp::Audio_File itpp::SND_Format itpp::SND_IO_File List of all members.

Public Types

 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
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_Out_File ()
 Constructor.
 SND_Out_File (const char *fname, int rate=8000, data_encoding e=enc_linear16)
 Open the file {fname}.
virtual ~SND_Out_File ()
 Destructor.
bool open (const char *fname, int rate=8000, data_encoding e=enc_linear16)
 Open the file {fname}.
virtual void close ()
 Close the file.
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}.
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.

Detailed Description

A class to write SND-files (the .au format)

ACTION: ADD DETAILED DOCUMENTATION FOR THIS CLASS!!!!!!!!!!!

Definition at line 172 of file audiofile.h.


Member Enumeration Documentation

enum itpp::SND_Format::data_encoding [inherited]

ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!!!

Definition at line 85 of file audiofile.h.


Constructor & Destructor Documentation

itpp::SND_Out_File::SND_Out_File (  ) 

Constructor.

Definition at line 389 of file audiofile.cpp.

itpp::SND_Out_File::SND_Out_File ( const char *  fname,
int  rate = 8000,
data_encoding  e = enc_linear16 
)

Open the file {fname}.

Definition at line 393 of file audiofile.cpp.

References open().

virtual itpp::SND_Out_File::~SND_Out_File (  )  [inline, virtual]

Destructor.

Definition at line 179 of file audiofile.h.

References close().


Member Function Documentation

bool itpp::SND_Out_File::open ( const char *  fname,
int  rate = 8000,
data_encoding  e = enc_linear16 
)

Open the file {fname}.

Definition at line 398 of file audiofile.cpp.

References close(), itpp::Audio_File::file, itpp::SND_Format::header, itpp::Audio_File::is_valid, and itpp::SND_Format::write_header().

Referenced by SND_Out_File(), and itpp::snd_write().

void itpp::SND_Out_File::close (  )  [virtual]

Close the file.

Reimplemented in itpp::SND_IO_File.

Definition at line 420 of file audiofile.cpp.

References itpp::Audio_File::file, itpp::SND_Format::header, itpp::Audio_File::is_valid, and itpp::SND_Format::write_header().

Referenced by open(), and ~SND_Out_File().

bool itpp::SND_Out_File::seek_write ( int  pos  ) 

Go to sample number {pos}.

Definition at line 429 of file audiofile.cpp.

References itpp::Audio_File::file, itpp::Audio_File::good(), itpp::SND_Format::header, and itpp::SND_Format::sample_size().

Referenced by itpp::SND_IO_File::open().

int itpp::SND_Out_File::tell_write (  ) 

Return the current sample position in the file.

Definition at line 441 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_Out_File::write ( const vec v  )  [virtual]

Write the vector {v}.

Definition at line 449 of file audiofile.cpp.

References itpp::Audio_File::file, itpp::Audio_File::good(), itpp::SND_Format::header, and it_warning.

Referenced by itpp::snd_write().

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 itpp::SND_In_File::read(), seek_write(), itpp::SND_In_File::tell_read(), tell_write(), and 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 itpp::SND_In_File::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(), itpp::SND_In_File::seek_read(), seek_write(), itpp::SND_In_File::tell_read(), and 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 itpp::SND_In_File::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(), close(), and open().


Member Data Documentation

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(), close(), itpp::SND_In_File::close(), itpp::Audio_File::good(), itpp::SND_IO_File::open(), open(), itpp::SND_In_File::open(), itpp::SND_In_File::read(), itpp::SND_In_File::seek_read(), seek_write(), itpp::SND_In_File::tell_read(), tell_write(), and 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(), close(), itpp::SND_In_File::close(), itpp::Audio_File::good(), itpp::SND_IO_File::open(), open(), and itpp::SND_In_File::open().

unsigned itpp::SND_Format::magic [protected, inherited]

Magic number.

Definition at line 112 of file audiofile.h.

unsigned itpp::SND_Format::hdr_size [protected, inherited]

Size of this header.

Definition at line 114 of file audiofile.h.

unsigned itpp::SND_Format::data_size [protected, inherited]

Length of data (optional).

Definition at line 116 of file audiofile.h.

unsigned itpp::SND_Format::encoding [protected, inherited]

Data encoding format.

Definition at line 118 of file audiofile.h.

unsigned itpp::SND_Format::sample_rate [protected, inherited]

Samples per second.

Definition at line 120 of file audiofile.h.

unsigned itpp::SND_Format::channels [protected, inherited]

Number of interleaved channels.

Definition at line 122 of file audiofile.h.

char itpp::SND_Format::info[SND_INFO_LEN] [protected, inherited]

Info string.

Definition at line 124 of file audiofile.h.

struct { ... } itpp::SND_Format::header [protected, inherited]

Definition of the header structure.

Referenced by itpp::SND_Format::channels(), close(), itpp::SND_Format::encoding(), open(), itpp::SND_Format::rate(), itpp::SND_In_File::read(), itpp::SND_Format::read_header(), itpp::SND_Format::sample_size(), itpp::SND_Format::samples(), itpp::SND_In_File::seek_read(), seek_write(), itpp::SND_Format::set_rate(), itpp::SND_In_File::tell_read(), tell_write(), write(), and itpp::SND_Format::write_header().


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

Generated on Wed Mar 21 12:22:31 2007 for IT++ by Doxygen 1.4.7