#include <endian.h>
#include <byteswap.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "camogm_wav.h"
#include "camogm.h"
#include <alsa/asoundlib.h>
Include dependency graph for camogm_wav.c:
Go to the source code of this file.
Data Structures | |
struct | WaveHeader |
struct | WaveFmtBody |
struct | WaveChunkHeader |
Defines | |
#define | COMPOSE_ID(a, b, c, d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24)) |
#define | LE_SHORT(v) (v) |
#define | LE_INT(v) (v) |
#define | BE_SHORT(v) bswap_16(v) |
#define | BE_INT(v) bswap_32(v) |
#define | WAV_RIFF COMPOSE_ID('R','I','F','F') |
#define | WAV_WAVE COMPOSE_ID('W','A','V','E') |
#define | WAV_FMT COMPOSE_ID('f','m','t',' ') |
#define | WAV_DATA COMPOSE_ID('d','a','t','a') |
#define | WAV_PCM_CODE 1 |
Functions | |
static int | begin_wave (int fd, size_t cnt) |
static void | end_wave (int fd) |
void | wave_begin (const char *fname) |
void | wave_push (void *buf, int len) |
void | wave_end () |
Variables | |
long long | fdcount = 0 |
int | wave_fd |
#define BE_INT | ( | v | ) | bswap_32(v) |
Definition at line 20 of file camogm_wav.c.
#define BE_SHORT | ( | v | ) | bswap_16(v) |
Definition at line 19 of file camogm_wav.c.
Definition at line 16 of file camogm_wav.c.
#define LE_INT | ( | v | ) | (v) |
#define LE_SHORT | ( | v | ) | (v) |
#define WAV_PCM_CODE 1 |
#define WAV_RIFF COMPOSE_ID('R','I','F','F') |
#define WAV_WAVE COMPOSE_ID('W','A','V','E') |
static int begin_wave | ( | int | fd, | |
size_t | cnt | |||
) | [static] |
Definition at line 64 of file camogm_wav.c.
References camogm_state::audio_channels, camogm_state::audio_format, camogm_state::audio_rate, f, LE_INT, LE_SHORT, WaveChunkHeader::length, WaveHeader::length, WaveHeader::magic, state, WaveChunkHeader::type, WaveHeader::type, WAV_DATA, WAV_FMT, WAV_PCM_CODE, WAV_RIFF, WAV_WAVE, and write.
Referenced by wave_begin().
static void end_wave | ( | int | fd | ) | [static] |
Definition at line 135 of file camogm_wav.c.
References fdcount, LE_INT, WaveChunkHeader::length, SEEK_SET, WaveChunkHeader::type, WAV_DATA, and write.
Referenced by wave_end().
void wave_begin | ( | const char * | fname | ) |
Definition at line 157 of file camogm_wav.c.
References begin_wave(), stderr, and wave_fd.
Referenced by audio_start().
void wave_end | ( | ) |
Definition at line 167 of file camogm_wav.c.
References end_wave(), and wave_fd.
Referenced by audio_end().
void wave_push | ( | void * | buf, | |
int | len | |||
) |
Definition at line 163 of file camogm_wav.c.
References fdcount, wave_fd, and write.
Referenced by audio_process().
long long fdcount = 0 |
int wave_fd |
Definition at line 155 of file camogm_wav.c.
Referenced by wave_begin(), wave_end(), and wave_push().