📄 wave.h
字号:
//*---------------------------------------------------------------------------
//* ATMEL Microcontroller Software Support - ROUSSET -
//*---------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*---------------------------------------------------------------------------
//* File Name : wave.h
//* Object : wave file description
//*
//* 1.0 21/01/02 JPP : Creation
//*---------------------------------------------------------------------------
#ifndef wave_h
#define wave_h
//* --------------------------- include file ----------------------------------
//* --------------------------- Constant definition ---------------------------
#define WAVE_MONO 1
#define WAVE_STEREO 2
#define WAVE_TYPE_PCM 1
#define WAVE_SAMPEL_RATE 8000
#define FILE_LOCATION 0x104000
/*--------------------------- Structure definition -------------------------*/
typedef struct
{
unsigned char riff[4]; // The word "riff"
unsigned int fileSize;
unsigned char wave[4]; // "wave"
unsigned char fmt[4]; // "fmt " (note space)
unsigned int fmtSize; // should be 16
unsigned short wavType; // 0x01 is PCM
unsigned short monoStereo; // mono=1 stereo=2
unsigned int sampleRate; // in Hz???
unsigned int sampleSpeed; // in bytes/second
unsigned short alignment; // block alignment
unsigned short sampleWidth; // in bits/sample
unsigned char data[4]; // "data"
unsigned int chunkSize; // Bytes in this data section
unsigned int dataStart; // The first actual sample
} WaveHeaderDESC;
typedef struct
{
WaveHeaderDESC *File;
volatile int cmpt;
int block_size;
char *ptr;
} WaveITDESC;
/*--------------------------- Function Prototyping -------------------------*/
extern void wave_print_header(WaveHeaderDESC *ptHeader);
extern int wave_check_header(WaveHeaderDESC *ptHeader);
extern void Setwave(void);
extern void OutputWave(char *ptr_data,int size);
#endif //* wave_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -