view wave.h @ 572:0f32f52fc98e

Make some small changes in trans so that it is more likely to produce the same output as mustrans when given misbehaving programs. Add lea to testcases.txt. Improve the output of comparetest.py so that known issues can easily be separated from new ones.
author Michael Pavone <pavone@retrodev.com>
date Mon, 03 Mar 2014 21:08:43 -0800
parents 140af5509ce7
children efc75ea79164
line wrap: on
line source

/*
 Copyright 2013 Michael Pavone
 This file is part of BlastEm. 
 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
*/
#ifndef WAVE_H_
#define WAVE_H_

#include <stdint.h>
#include <stdio.h>

#pragma pack(push, 1)

typedef struct {
	char     id[4];
	uint32_t size;
	char     format[4];
} riff_chunk;

typedef struct {
	char     id[4];
	uint32_t size;
} riff_sub_chunk;

typedef struct {
	riff_chunk     chunk;
	riff_sub_chunk format_header;
	uint16_t       audio_format;
	uint16_t       num_channels;
	uint32_t       sample_rate;
	uint32_t       byte_rate;
	uint16_t       block_align;
	uint16_t       bits_per_sample;
	riff_sub_chunk data_header;
} wave_header;

#pragma pack(pop)

int wave_init(FILE * f, uint32_t sample_rate, uint16_t bits_per_sample, uint16_t num_channels);
int wave_finalize(FILE * f);

#endif //WAVE_H_