1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef _LEARN_AUDIO_H_
- #define _LEARN_AUDIO_H_
- #ifdef ENABLE_ENABLE_AMRNB
- #include "wamr.h"
- #endif
- #ifdef ENABLE_ENABLE_SPEEX
- #include "speex.h"
- #endif
- #define MAX_FRAMES_TOTAL (1*60*50)
- #ifdef ENABLE_ENABLE_AMRNB
- #define FRAME_PER_SIZE 32
- #define FRAME_ENCODE_TYPE 0x3c
- #endif
- #ifdef ENABLE_ENABLE_SPEEX
- #define FRAME_QULITY 5
- #define FRAME_PER_SIZE 28
- #endif
- typedef enum{
- LEARN_PLY_IDLE,
- LEARN_PLY_BUSY,
- LEARN_PLY_PRE_ERR,
- LEARN_PLY_FAILED,
- LEARN_PLY_DONE
- }LEARN_PLY_ENUM;
- typedef struct{
- unsigned char *pcm;
- unsigned int frameNum;
- unsigned short frameSize;
- unsigned int plyNum;
- #ifdef ENABLE_ENABLE_SPEEX
- void *speexCt;
- SpeexBits bits;
- #endif
- unsigned char playType;
- bool stopPlay;
- int fd;
- }LEARN_REC_DEF;
- bool learnStartRecord(unsigned char charaNum);
- void learnStopRecord(void);
- void learnRecordFree(void);
- void learnRecordBufRelease(void);
- void learnPlayAudio(unsigned char type, const char *fname);
- LEARN_PLY_ENUM learnPlyGetResult(void);
- unsigned char learnGetAudioType(void);
- void learnStopPlaying(void);
- void recordSaveTmpToLocal(char *fileName);
- unsigned char *learnGetTmpAudioBuf(void);
- unsigned int learnGetTmpAudioLength(void);
- unsigned short learnGetRecordMaxVolume(void);
- float learnGetRecordRecSpeed(void);
- #ifdef SAVE_PCM_SD
- void pcmFileOpen(void);
- void pcmFileClose(void);
- #endif
- #endif
|