PortAudio 2.0
write_wav.h File Reference

Go to the source code of this file.

Data Structures

struct  WAV_Writer_s
 

Macros

#define RIFF_ID   (('R'<<24) | ('I'<<16) | ('F'<<8) | 'F')
 
#define WAVE_ID   (('W'<<24) | ('A'<<16) | ('V'<<8) | 'E')
 
#define FMT_ID   (('f'<<24) | ('m'<<16) | ('t'<<8) | ' ')
 
#define DATA_ID   (('d'<<24) | ('a'<<16) | ('t'<<8) | 'a')
 
#define FACT_ID   (('f'<<24) | ('a'<<16) | ('c'<<8) | 't')
 
#define WAV_ERR_CHUNK_SIZE   (-1) /* Chunk size is illegal or past file size. */
 
#define WAV_ERR_FILE_TYPE   (-2) /* Not a WAV file. */
 
#define WAV_ERR_ILLEGAL_VALUE   (-3) /* Illegal or unsupported value. Eg. 927 bits/sample */
 
#define WAV_ERR_FORMAT_TYPE   (-4) /* Unsupported format, eg. compressed. */
 
#define WAV_ERR_TRUNCATED   (-5) /* End of file missing. */
 
#define WAVE_FORMAT_PCM   (1)
 
#define WAVE_FORMAT_IMA_ADPCM   (0x0011)
 

Typedefs

typedef struct WAV_Writer_s WAV_Writer
 

Functions

long Audio_WAV_OpenWriter (WAV_Writer *writer, const char *fileName, int frameRate, int samplesPerFrame)
 
long Audio_WAV_WriteShorts (WAV_Writer *writer, short *samples, int numSamples)
 
long Audio_WAV_CloseWriter (WAV_Writer *writer)
 

Macro Definition Documentation

◆ DATA_ID

#define DATA_ID   (('d'<<24) | ('a'<<16) | ('t'<<8) | 'a')

Referenced by Audio_WAV_OpenWriter().

◆ FACT_ID

#define FACT_ID   (('f'<<24) | ('a'<<16) | ('c'<<8) | 't')

◆ FMT_ID

#define FMT_ID   (('f'<<24) | ('m'<<16) | ('t'<<8) | ' ')

Referenced by Audio_WAV_OpenWriter().

◆ RIFF_ID

#define RIFF_ID   (('R'<<24) | ('I'<<16) | ('F'<<8) | 'F')

Referenced by Audio_WAV_OpenWriter().

◆ WAV_ERR_CHUNK_SIZE

#define WAV_ERR_CHUNK_SIZE   (-1) /* Chunk size is illegal or past file size. */

◆ WAV_ERR_FILE_TYPE

#define WAV_ERR_FILE_TYPE   (-2) /* Not a WAV file. */

◆ WAV_ERR_FORMAT_TYPE

#define WAV_ERR_FORMAT_TYPE   (-4) /* Unsupported format, eg. compressed. */

◆ WAV_ERR_ILLEGAL_VALUE

#define WAV_ERR_ILLEGAL_VALUE   (-3) /* Illegal or unsupported value. Eg. 927 bits/sample */

◆ WAV_ERR_TRUNCATED

#define WAV_ERR_TRUNCATED   (-5) /* End of file missing. */

◆ WAVE_FORMAT_IMA_ADPCM

#define WAVE_FORMAT_IMA_ADPCM   (0x0011)

◆ WAVE_FORMAT_PCM

#define WAVE_FORMAT_PCM   (1)

Referenced by Audio_WAV_OpenWriter().

◆ WAVE_ID

#define WAVE_ID   (('W'<<24) | ('A'<<16) | ('V'<<8) | 'E')

Referenced by Audio_WAV_OpenWriter().

Typedef Documentation

◆ WAV_Writer

typedef struct WAV_Writer_s WAV_Writer

Function Documentation

◆ Audio_WAV_CloseWriter()

◆ Audio_WAV_OpenWriter()

long Audio_WAV_OpenWriter ( WAV_Writer * writer,
const char * fileName,
int frameRate,
int samplesPerFrame )

◆ Audio_WAV_WriteShorts()

long Audio_WAV_WriteShorts ( WAV_Writer * writer,
short * samples,
int numSamples )