74 #include <sphinxbase/sphinxbase_export.h>
76 #include <sphinxbase/byteorder.h>
92 #define BYTE_ORDER_MAGIC (0x11223344)
99 #define REVERSE_SENSE_SWAP_INT16(x) x = ( (((x)<<8)&0x0000ff00) | (((x)>>8)&0x00ff) )
100 #define REVERSE_SENSE_SWAP_INT32(x) x = ( (((x)<<24)&0xff000000) | (((x)<<8)&0x00ff0000) | \
101 (((x)>>8)&0x0000ff00) | (((x)>>24)&0x000000ff) )
103 #define REVERSE_SENSE_SWAP_INT16(x)
104 #define REVERSE_SENSE_SWAP_INT32(x)
142 int32 bio_writehdr(FILE *fp, ...);
262 char const *filename,
263 char const *extension,
SPHINXBASE_EXPORT int16 * bio_read_wavfile(char const *directory, char const *filename, char const *extension, int32 header, int32 endian, int32 *nsamps)
Read raw data from the wav file.
SPHINXBASE_EXPORT int32 bio_fread_3d(void ****arr, size_t e_sz, uint32 *d1, uint32 *d2, uint32 *d3, FILE *fp, uint32 swap, uint32 *chksum)
Read a 3-d array (set of matrices)
Basic type definitions used in Sphinx.
SPHINXBASE_EXPORT int32 bio_fread_1d(void **buf, size_t el_sz, uint32 *n_el, FILE *fp, int32 sw, uint32 *ck)
Read a 1-d array (fashioned after fread):
SPHINXBASE_EXPORT int32 bio_fwrite(void *buf, int32 el_sz, int32 n_el, FILE *fp, int32 swap, uint32 *chksum)
Like fwrite but perform byteswapping and accumulate checksum (the 2 extra arguments).
SPHINXBASE_EXPORT int32 bio_fread_2d(void ***arr, size_t e_sz, uint32 *d1, uint32 *d2, FILE *fp, uint32 swap, uint32 *chksum)
Read a 2-d matrix:
SPHINXBASE_EXPORT int32 bio_writehdr_version(FILE *fp, char *version)
Write a simple binary file header, containing only the version string.
SPHINXBASE_EXPORT int32 bio_fread(void *buf, int32 el_sz, int32 n_el, FILE *fp, int32 swap, uint32 *chksum)
Like fread but perform byteswapping and accumulate checksum (the 2 extra arguments).
SPHINXBASE_EXPORT void bio_verify_chksum(FILE *fp, int32 byteswap, uint32 chksum)
Read and verify checksum at the end of binary file.
SPHINXBASE_EXPORT void bio_hdrarg_free(char **name, char **val)
Free name and value strings previously allocated and returned by bio_readhdr.
SPHINXBASE_EXPORT int32 bio_readhdr(FILE *fp, char ***name, char ***val, int32 *swap)
Read binary file format header: has the following format.