41 #define SND_INFO_LEN 8
149 virtual bool open(
const char *fname);
151 virtual void close();
159 virtual bool read(vec &v);
161 virtual bool read(vec &v,
int n);
187 virtual void close();
195 virtual bool write(
const vec &v);
215 virtual bool open(
const char *fname);
217 virtual void close();
323 bool raw16le_read(
const char *fname, vec &v,
int beg,
int len);
325 bool raw16le_write(
const char *fname,
const vec &v,
bool append =
false);
330 bool raw16be_read(
const char *fname, vec &v,
int beg,
int len);
332 bool raw16be_write(
const char *fname,
const vec &v,
bool append =
false);
335 bool snd_read(
const char *fname, vec &v);
337 bool snd_read(
const char *fname, vec &v,
int beg,
int len);
339 bool snd_write(
const char *fname,
const vec &v,
int rate = 8000,
355 int bytes =
sizeof(T);
356 char *c =
reinterpret_cast<char *
>(&data);
357 if (!switch_endian) {
361 for (
int i = bytes - 1; i >= 0; i--)
369 inline void write_endian(std::ostream &s, T data,
bool switch_endian =
false)
371 int bytes =
sizeof(T);
372 char *c =
reinterpret_cast<char *
>(&data);
373 if (!switch_endian) {
377 for (
int i = bytes - 1; i >= 0; i--)
386 #endif // #ifndef AUDIOFILE_H