📄 audio.h
字号:
///////////////////////////////////////////////////////// FileName: audio.h// Author: b1gm0use// Project: myvideo#ifndef _AUDIO_H_#define _AUDIO_H_#include <qevent.h>#include <linux/soundcard.h>// 自定义事件号const int AUDIO_EVENT = QEvent::User+100;const char * const DEFAULT_AUDIO_DEVICE = "/dev/dsp";// 存储次数const int LENGTH = 9;// 采样频率const int RATE = 48000;// 量化位数const int SIZE = AFMT_S16_LE;// 声道数目const int CHANNELS = 2;// 30ms原声音数据const int BUFF_SIZE = RATE * 2 * CHANNELS * 30 / 1000;const unsigned int BUFF_SIZE_WORD = BUFF_SIZE / 2;// 30ms G723数据const unsigned int BUFF_SIZE_G723 = 24;const unsigned int BUFF_SIZE_G711 = BUFF_SIZE / 24;const bool DEFAULT_USE_G723 = false;const unsigned int AUDIO_BUFF_HEAD_SIZE = sizeof( int );const unsigned int MAX_AUDIO_BUFF_SIZE = BUFF_SIZE_G711 * LENGTH + AUDIO_BUFF_HEAD_SIZE;const unsigned int FULL_AUDIO_BUFF_SIZE = BUFF_SIZE * LENGTH;#ifdef _ARM_CODEC_#define CODEC_LIB "libcodecarm.so.1"#else#define CODEC_LIB "libcodecpc.so.1"#endif // _ARM_CODECtypedef short int WORD16;#endif // _AUDIO_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -