⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audio_in.h

📁 MP3编码库
💻 H
字号:
#ifndef _AUDIO_IN_H_
#define _AUDIO_IN_H_

//#include ".\libmp3enc\libmp3enc.h"
enum byte_order { order_unknown, order_bigEndian, order_littleEndian };


#define FILE_AIFF	0
#define FILE_WAVE	1
#define FILE_RAW	2

i32	  get_file_type(FILE *file);
i32   aiff_read_headers();
i32   wave_read_headers();
i32   aiff_seek_to_sound_data();

enum  byte_order DetermineByteOrder();
u32 read_samples(FILE *musicin, i16 sample_buffer[2304], u32 frame_size, i32 file_type);
u32 get_audio( FILE *musicin, i16 buffer[2][1152], u32 num_samples, i32 stereo, layer *info, i32 file_type );

/* AIFF Definitions */

#define IFF_ID_FORM 0x464f524d /* "FORM" */
#define IFF_ID_AIFF 0x41494646 /* "AIFF" */
#define IFF_ID_COMM 0x434f4d4d /* "COMM" */
#define IFF_ID_SSND 0x53534e44 /* "SSND" */
#define IFF_ID_MPEG 0x4d504547 /* "MPEG" */

/* ID related to WAVE file format */
#define WAV_ID_RIFF 0x52494646 /* "RIFF" */
#define WAV_ID_WAVE 0x57415645 /* "WAVE" */
#define WAV_ID_FMT  0x666d7420 /* "fmt " */
#define WAV_ID_DATA 0x64617461 /* "data" */

#define AIFF_FORM_HEADER_SIZE 12
#define AIFF_SSND_HEADER_SIZE 16


typedef struct  blockAlign_struct {
    u32   offset;
    u32   blockSize;
} blockAlign;

typedef struct  IFF_AIFF_struct {
    i16         numChannels;
    u32			numSampleFrames;
    i16         sampleSize;
    double		sampleRate;
    u32			sampleType;
    blockAlign	blkAlgn;
} IFF_AIFF;


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -