📄 provavoice.c
字号:
/* provavoice, test program to check basic features of voice * Copyright (C) 2004 Simone Freddio & Andrea Emanuelli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#include <unistd.h>#include "libevent.h"#include "libvoice.h"int exitnow = 0;int ringhandler(int argc, char **argv);int dtmfhandler(int argc, char **argv);int dtmfhandler(int argc, char **argv){ if (argv[1][0] == '1') { libvoice_beep(1120, 20); } if (argv[1][0] == '*') { exitnow = 1; } return true;}int ringhandler(int argc, char **argv){ libvoice_answer(); libvoice_beep(440, 20); libvoice_beep(660, 20); libvoice_beep(880, 20); return true;}int main(int argc, char**argv){ libvoice_init("ttyS0"); libevent_add_handler(ringhandler, "LV_RINGING"); libevent_add_handler(dtmfhandler, "LV_DTMF"); libvoice_sendcmd("Mute");/* libvoice_selectdialupline();*/ libvoice_setdevice(EXTERNAL_SPEAKER); while (exitnow == 0) libvoice_processevent(); libvoice_hangup(); libvoice_shutdown(); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -