git-svn-id: http://svn.openzap.org/svn/openzap/trunk@328 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2007-11-15 22:05:41 +00:00
parent df25daeaae
commit 86fc8ff116
2 changed files with 50 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
//#include "openzap.h"
#include "libteletone_detect.h"
int main(int argc, char *argv[])
{
teletone_generation_session_t ts;
teletone_multi_tone_t mt = {0};
teletone_tone_map_t map = {350.0, 440.0, 0.0};
int fd, b;
short sln[512] = {0};
if (argc < 2) {
fprintf(stderr, "Arg Error!\n");
exit(-1);
}
teletone_multi_tone_init(&mt, &map);
if ((fd = open(argv[1], O_RDONLY)) < 0) {
fprintf(stderr, "File Error!\n", strerror(errno));
exit(-1);
}
while((b = read(fd, sln, 320)) > 0) {
printf("TEST %d %d\n", b, teletone_multi_tone_detect(&mt, sln, b / 2));
}
close(fd);
}