📄 240.c
字号:
//======================================================================================
//
// The information contained herein is the exclusive property of
// Sunplus Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
//
// (C) COPYRIGHT 2001 SUNPLUS TECHNOLOGY CO.
// ALL RIGHTS RESERVED
//
// The entire notice above must be reproduced on all authorized copies.
//
//========================================================================================
// 工程名称: S240.spj
// 功能描述: SACM-2400以自动方式播放
//
// 文件来源: 《SPCE061单片机原理及应用技术》第七章 凌阳音频压缩算法,第281页
// IDE环境: SUNPLUS u'nSPTM IDE 1.8.0(or later)
//
// 涉及的库: CMacro.lib/sacmv25.lib
//
// 组成文件: 240.c
// ISR.asm/hardware.asm
// hardware.inc/hardware.h
//
// 日期: 2002-6-12
//===========================================================================================
#include "hardware.h"
#include "s240.h"
#define DAC1 1
#define DAC2 2
#define Ramp_UpDn_Off 0
#define Ramp_Up_On 1
#define Ramp_Dn_On 2
#define Ramp_UpDn_On 3
#define MaxSpeechNum 3 //播放语音的最大个数
#define Auto 1
main()
{
int SpeechIndex = 0; // 选择第一首语音
while(1)
{
SACM_S240_Initial(Auto);
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On);// 播放第一首
while(SACM_S240_Status()&0x01)//判断第一首是否播完
SACM_S240_ServiceLoop();
SpeechIndex++;
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On);//播放第二首
while(SACM_S240_Status()&0x01)//判断第二首是否播完
SACM_S240_ServiceLoop();
SpeechIndex++;
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On);//播放第三首
while(SACM_S240_Status()&0x01)
SACM_S240_ServiceLoop();
SpeechIndex=0; //重新播放
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -