Nsound
0.9.4
|
#include <Nsound/Nsound.h>
#include <Nsound/AudioStream.h>
#include <Nsound/Buffer.h>
#include <Nsound/Wavefile.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <fstream>
#include <iostream>
#include <sstream>
Go to the source code of this file.
Classes | |
struct | RawTag |
Macros | |
#define | LM_UNUSED __attribute__((unused)) |
#define | NOT_FOUND -1 |
#define | IO_ERROR -2 |
#define | MIN(a, b) ((a < b) ? a : b) |
Typedefs | |
typedef struct RawTag | RawTag |
Functions | |
static int64 | swapBytesInt64 (const uint64 &i) |
Endian Conversion. More... | |
static int64 | swapBytesInt48 (const uint64 &i) |
static int32 | swapBytesInt32 (const uint32 i) |
static int32 | swapBytesInt24 (const uint32 i) |
static int32 | swapBytesInt16 (const uint32 i) |
static int64 | readInt (FILE *fd, uint32 n_bytes) |
static float32 | readFloat32 (FILE *fd) |
static float64 | readFloat64 (FILE *fd) |
static void | writeInt (FILE *output, uint32 n_bytes, int64 value) |
static void | writeFloat32 (FILE *output, float32 value) |
static void | writeFloat64 (FILE *output, float64 value) |
int64 | findID3v1Tag (FILE *fin) |
#define LM_UNUSED __attribute__((unused)) |
Definition at line 238 of file Wavefile.cc.
Referenced by readFloat32(), readFloat64(), and readInt().
#define NOT_FOUND -1 |
Definition at line 1550 of file Wavefile.cc.
Referenced by findID3v1Tag(), Nsound::ID3v1Tag::read(), and Nsound::ID3v1Tag::write().
#define IO_ERROR -2 |
Definition at line 1551 of file Wavefile.cc.
Referenced by findID3v1Tag(), Nsound::ID3v1Tag::read(), and Nsound::ID3v1Tag::write().
#define MIN | ( | a, | |
b | |||
) | ((a < b) ? a : b) |
Referenced by Nsound::ID3v1Tag::write().
Endian Conversion.
little endian: intel big endian: power pc, sparc
4 bytes little endian byte order: 1234 big endian byte order: 4321
3 bytes little endian byte order: 123 big endian byte order: 321
2 bytes little endian byte order: 12 big endian byte order: 21
The method below takes an int and swaps the bytes. Note that on either endian system the method will do the correct converstion. That is, a big endian value will become a little (4321 –> 1234), and a little endian becomes big (1234 –> 4321).
Definition at line 157 of file Wavefile.cc.
Referenced by readFloat64(), readInt(), writeFloat64(), and writeInt().
Definition at line 182 of file Wavefile.cc.
Definition at line 206 of file Wavefile.cc.
Referenced by readFloat32(), readFloat64(), writeFloat32(), and writeFloat64().
Definition at line 216 of file Wavefile.cc.
Definition at line 225 of file Wavefile.cc.
This method reads data from the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 246 of file Wavefile.cc.
References LM_UNUSED, and swapBytesInt64().
Referenced by findID3v1Tag().
|
inlinestatic |
This method reads data from the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 305 of file Wavefile.cc.
References LM_UNUSED, and swapBytesInt32().
|
inlinestatic |
This method reads data from the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 325 of file Wavefile.cc.
References LM_UNUSED, swapBytesInt32(), and swapBytesInt64().
This method writes data to the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 346 of file Wavefile.cc.
References swapBytesInt64().
Referenced by Nsound::Wavefile::write().
|
inlinestatic |
This method writes data to the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 364 of file Wavefile.cc.
References swapBytesInt32().
Referenced by Nsound::Wavefile::write().
|
inlinestatic |
This method writes data to the file and does the proper byte conversion based on the endianess of the platform.
Definition at line 382 of file Wavefile.cc.
References swapBytesInt32(), and swapBytesInt64().
Referenced by Nsound::Wavefile::write().
int64 findID3v1Tag | ( | FILE * | fin | ) |
Definition at line 1554 of file Wavefile.cc.
References Nsound::Wavefile::DATA_, IO_ERROR, M_CHECK_PTR, M_THROW, NOT_FOUND, readInt(), Nsound::Wavefile::RIFF_, and Nsound::Wavefile::WAVE_.
Referenced by Nsound::ID3v1Tag::read(), and Nsound::ID3v1Tag::write().