⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbufrecorder.cpp

📁 三汇CTI示例程序源码
💻 CPP
字号:

// DBufRecorder.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "function.h"
#include <iostream.h>

int nChRec;			//number of recorder channel
int nChPlay;		//number of player channel
extern BOOL bMemIsInUse;	//flag of use buffer


int main(int argc, char* argv[])
{
	int nLoopNum = 0;		//set used time (s)
	int nMaxCh = 0;
	char cTempArray[128];
	memset(cTempArray, '\0', sizeof(cTempArray));
	
	cout<<"initialize Cti System\n"<<"......"<<endl;
	if(InitCtiSystem() == FALSE)
	{
		cout<<"fail to initialize,program exit"<<endl;
		return FALSE;
	}
	cout<<"initialize successfully"<<endl<<endl;

	nMaxCh = SsmGetMaxCh();

	for(nLoopNum=0; nLoopNum<10; nLoopNum++)
	{
		cout<<"please input number of channel(record):";
		cin>>nChRec;
		cout<<"please input number of channel(play):";
		cin>>nChPlay;
		if(nChRec>=0 && nChRec<nMaxCh && nChPlay>=0 && nChPlay<nMaxCh)
			break;
		cout<<"input error! please input again!"<<endl;
	}
	if(nLoopNum >= 10)
	{
		cout<<"input error ten times,program exit."<<endl;
		exit(0);
	}

    SsmSetRecVolume(nChRec, 1);		//set increment of record channel
    SsmSetPlayVolume(nChPlay, 2);	//set increment of play channel


	while(1)
	{
		memset(cTempArray, '\0', sizeof(cTempArray));
		cin.getline(cTempArray, 128, '\n');
		if(cTempArray[0] == 'Q' || cTempArray[0] == 'q')
		{
			break;
		}

		bMemIsInUse = FALSE;
		RecStart(nChRec);
		cout<<endl<<"start to work. ......"<<endl;
		for(nLoopNum=0; nLoopNum<5; nLoopNum++)
		{//run time ctrl
			Sleep(1000);
		}
		RecEnd(nChRec);
		PlayEnd(nChPlay);

		cout<<"QUIT:please input(Q/q), CONTINUE:please input any key"<<endl;
	}


	cout<<"finish to work."<<endl;

	SsmCloseCti();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -