📄 main.c
字号:
//======================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//========================================================
//============================================================
// 工程名称:S480_key.scs
// 功能描述:
//
// 文件来源:
//
// IDE环境: SUNPLUS u'nSPTM IDE 1.8.0
//
// 涉及的库:
// SACMV25.lib
// 组成文件:
// hardware.asm
// key.asm
// isr.asm
// s480.inc
// s480.h
//
// 日期: 2003-7-7
//===============================================
//============================================================
// 文件名称:main.c
// 实现功能:利用s480格式键控语音播放
// 日期: 2003/7/7
//============================================================
#include "s480.h"
#define DAC1 1
#define DAC2 2
#define Ramp_UpDn_Off 0
#define Ramp_UpDn_On 3
#define Manual 0
#define Auto 1
#define Full 1
#define Empty 2
//=============================================================
// 函数名称: int main()
// 功能描述: 语音播放、暂停、停止
// 语法格式: int main()
// 注意事项: 仅为用户模型
//=================================================================
int main()
{
int iTarget = 0; // 初始化键值
int iBia =0;
int iSpeechIndex = 9; // 初始化语音播放序号
int iSpeechResult = 0;
int iMode;
int iKick=0;
iMode = Auto;
System_Initial();
SACM_S480_Initial(iMode);
SACM_S480_Play(iSpeechIndex,DAC1+DAC2,Ramp_UpDn_On);
while(SACM_S480_Status()&0x0001)
{
SACM_S480_ServiceLoop();
}
SACM_S480_Stop();
iSpeechIndex = 0 ;
while(1)
{
iKick = 0 ;
iBia = SP_SetCh();
switch(iBia)
{
case 0x0000:
break;
case 0x0001:
iSpeechIndex=5; //11
break;
case 0x0002:
iSpeechIndex=6; //12
break;
case 0x0003:
iSpeechIndex=7; //13
break;
case 0x0004:
iSpeechIndex=8; //15
break;
default:
break;
}
iTarget = SP_GetCh();
iSpeechResult=0;
switch(iTarget)
{
case 0x00:
iKick=0;
break;
case 0x01:
iKick=1;
iSpeechResult=0; //6
break;
case 0x02:
iKick=1;
iSpeechResult=1; //7
break;
case 0x04:
iKick=1;
iSpeechResult=2; //8
break;
case 0x08:
iKick=1;
iSpeechResult=3; //9
break;
case 0x10:
iKick=1;
iSpeechResult=4; //10
break;
default:
break;
}
if(iKick!=0)
{
SACM_S480_Play(iSpeechResult,DAC1+DAC2,Ramp_UpDn_On);
while(SACM_S480_Status()&0x0001)
{SACM_S480_ServiceLoop();}
SACM_S480_Stop();
SACM_S480_Play(iSpeechIndex,DAC1+DAC2,Ramp_UpDn_On);
while(SACM_S480_Status()&0x0001)
{SACM_S480_ServiceLoop();}
SACM_S480_Stop();
}
System_ServiceLoop(); //
// SACM_S480_ServiceLoop(); //获取语音数据并将其填入解码队列,来自sacmv25.lib
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -