?? playsound.h
字號:
#ifndef PLAY_SOUND
#define PLAY_SOUND
typedef enum _play_type
{
NO_PLAYSOUND = 0,//沒有播放任何類型的聲音
STATION_PLAY,//正在報站
NOTION_PLAY//正在播放服務用語
}PLAY_TYPE;
/****************定義小喇叭的狀態*****/
#define SPEAKER_IDLE 0//無提示語音播放任務
#define SPEAKER_BUSY 1//還有需要的語音要讀
#define SPEAKER_NOMOREDATA 2//已經沒有數據需要讀,但是當前MSM還在播放語音
typedef struct _littlespeaker_pointer
{
Byte status;//當前狀態
Uint16 pointVal;//由于不涉及到子串,因此只需要這一個變量
Uint32 nPosition; //當前位置
}LITTLESPEAKER_POINTER;
//需要考慮到串中帶有串的問題,如當前站、終點站
typedef struct _play_buffer
{
PLAY_TYPE type;
Byte readFlag;//讀取文件的指示器,如果值為SOUND_OFF表示全部讀完,否則表示還有數據沒有讀完
Uint8 setAddr;//第幾串(值從1開始)
Uint8 valid;//1表示當前讀pointVal
Uint8 stationVal;//第幾個站,//播放文明用語時,這個值無效
Uint16 pointVal;//在toneArrayPointer中的存放位置
Uint16 pointVal2;
Uint32 nPosition;//當前讀取到語音段中的位置
}PLAY_BUFFER;//播放語音的緩存
#define PLAY_TIMEOUT 2
/***************報站緩沖隊列****************************/
typedef struct _play_queue
{
Byte valid;//隊列中是否有元素
Byte timeout;//超時計數器
Byte nValue; //要播放的固定短語
}PLAY_QUEUE;
void del_play_queue();
void add_play_queue(Byte value);
void playqueue_timeout();
void check_playqueue();
void play_init(void);
void play_stationsound(Uint8 curStation/*站點序號*/, Byte attrStation/*到站/出站/首站*/);
/**********播放語音串***************/
/*nValue:值從1開始
/***********************************/
void play_toneArray(Uint8 nValue, PLAY_TYPE type);
/************************************
*停止報站
**************************************/
void stop_board();
/*****************************************
*是否可以播放拐彎
*返回值:OK表示允許拐彎,KO表示不允許拐彎
*****************************************/
Byte is_playconner();
/************************************
*當前是否語音播放模塊是否還需要讀flash
*返回值:OK表示不需要讀;KO表示還需要讀flash
************************************/
Byte is_playReadFlash();
/************播放文明用語************/
/*nNum:值從1開始,值為0xff表示按下取消鍵,
/* 停止播放所有語音
/*nNum:值為9表示播放拐彎
/*nNum:值為10表示要播放下坡
/********************************/
void play_notitionsound(Uint8 nNum/*播放第幾個文明用語*/);
/****播放小喇叭提示音****/
void play_littlespeaker(Byte type);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -