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

📄 pamrdec.h

📁 瑞星微公司RK27XX系列芯片的SDK开发包
💻 H
字号:
//
//
//

#ifndef __AMR_DEC_H__
#define __AMR_DEC_H__

/*
 *  Struct
 */
 
typedef struct
{
    int SampleRate;     // 采样率
    int BitsPerSample;  // 位数
    int BitRate;        // 比特率, bps
    int NumOfChannel;   // 声道数   
    int DurationTime;   // 文件持续时间,单位为:ms
    int DecodedSamples; // 当前已解出的样点数
    int BytesPerFrame;  // 一帧有多少字节的数据
    int AMRHeaderSize;  // AMR头长度
    
} sAMRFileInfo;

/*
 *  Functions
 */

/*
 函数: amr_decoder_seek
 描述: seek到指定点进行解码
 参数: IN [fp]   --  amr文件指针
       OUT[info] --  amr文件基本信息
       IN [time] --  所要Seek的时间,ms
 返回: 0: 成功;other:失败
*/
int amr_decoder_seek(void *fp, sAMRFileInfo *info, int time);

/*
 函数: amr_docoder_init
 描述: 初始化解码器
 参数: IN [fp]   --  amr文件指针
       OUT[info] --  amr文件基本信息
 返回: 0: 成功;other:失败
*/
int amr_docoder_init(void *fp, sAMRFileInfo *info);

/*
 函数: amr_docoder_dec
 描述: 解码出一帧的数据,每帧长度固定为160个样点
 参数: IN [fp]     --  amr文件指针
       OUT[info]   --  amr文件基本信息 
       OUT[outbuf] --  解码输出的pcm数据固定为单声道,长度为160
 返回: 0: 成功;other:解码结束或失败
*/
int amr_docoder_dec(void *fp, sAMRFileInfo *info, short *outbuf);

/*
 函数: amr_docoder_reset
 描述: 重启解码器
 参数: 无
 返回: 0: 成功;other:失败
*/
int amr_docoder_reset(void);

/*
 函数: amr_docoder_close
 描述: 关闭解码器
 参数: 无
 返回: 0: 成功;other:失败
*/
int amr_docoder_close(void);

/* AMR File IO */
int AMR_FRead(void *fp, unsigned char *buf, int size);
int AMR_FSeek(void *fp, int where, int how);
int AMR_FLength(void *fp);

#endif

⌨️ 快捷键说明

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