voice_set_device problems
Eric Plaster (plaster@imageman.com)
Thu, 03 Jun 1999 10:11:54 -0500
--------------909ED3C638EEEED842FC4CDB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello everyone!
I need some help with the libvoice stuff. I'm righting a voicemail
frontend to vgetty and started using by just calling vm on the command
line. Soon I realized that I could just use the libvoice the same way
that vm does. So I got it work. The problem now is that I need to do
the following in C:
vm play -s /path/name.rmd and
vm record -m /path/name.rmd
To do this I initialize the library like this:
check_system();
voice_config("vm", "");
voice_register_event_handler(vm_voice_events);
if (getenv("VOICE_PID") == NULL)
{
int tries = 0;
while (((result = voice_open_device()) != OK) && ((++tries) <
cvd.max_tries.d.i))
{
sleep(cvd.retry_delay.d.i);
}
if (result != OK)
{
printf("vmail: could not open a voice modem device\n");
exit(FAIL);
};
voice_mode_on();
if (voice_set_device(voice_device) != OK)
{
printf("%s: could not set voice device\n",
program_name);
exit(FAIL);
};
}
}
voice_device is set to INTERNAL_SPEAKER.
when I switch to EXTERNAL_MICROPHONE like this,
int voice_device = EXTERNAL_MICROPHONE;
if (voice_set_device(voice_device) != OK)
{
printf("%s: could not set voice device\n",
program_name);
exit(FAIL);
};
fprintf(stderr, "vmail: recording voice file %s\n", file);
voice_record_file(file);
I get this error:
vm: Modem returned ERROR
How do I set the EXTERNAL_MICROPHONE so that I can record from the mic?
Also, how does the "voice_config("vm", "");" functino work? I couldn't
get it to work until I put vm in there.
Is there any documentation on the libvoice out there?
--
Eric Plaster Image Manipulation Systems
Software Engineer (612)753-5602 x117
plaster@imageman.com www.imageman.com
--------------909ED3C638EEEED842FC4CDB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<BR>Hello everyone!
<P>I need some help with the libvoice stuff. I'm righting a voicemail
frontend to vgetty and started using by just calling vm on the command
line. Soon I realized that I could just use the libvoice the same
way that vm does. So I got it work. The problem now is that
I need to do the following in C:
<BR> vm play -s /path/name.rmd
and
<BR> vm record -m /path/name.rmd
<P>To do this I initialize the library like this:
<P> check_system();
<BR> voice_config("vm", "");
<BR> voice_register_event_handler(vm_voice_events);
<BR> if (getenv("VOICE_PID") == NULL)
<BR> {
<BR> int tries = 0;
<P> while (((result = voice_open_device()) != OK) && ((++tries)
<
<BR> cvd.max_tries.d.i))
<BR> {
<BR> sleep(cvd.retry_delay.d.i);
<BR> }
<P> if (result != OK)
<BR> {
<BR> printf("vmail: could not open a voice modem device\n");
<BR> exit(FAIL);
<BR> };
<P> voice_mode_on();
<P> if (voice_set_device(voice_device) != OK)
<BR> {
<BR> printf("%s: could not set voice device\n",
<BR> program_name);
<BR> exit(FAIL);
<BR> };
<BR> }
<BR>}
<P>voice_device is set to INTERNAL_SPEAKER.
<BR>when I switch to EXTERNAL_MICROPHONE like this,
<P> int voice_device = EXTERNAL_MICROPHONE;
<BR> if (voice_set_device(voice_device) != OK)
<BR> {
<BR> printf("%s: could not set voice device\n",
<BR> program_name);
<BR> exit(FAIL);
<BR> };
<BR> fprintf(stderr, "vmail: recording voice file %s\n", file);
<BR> voice_record_file(file);
<P>I get this error:
<BR>vm: Modem returned ERROR
<P>How do I set the EXTERNAL_MICROPHONE so that I can record from the mic?
<P>Also, how does the "voice_config("vm", "");" functino work? I
couldn't get it to work until I put vm in there.
<P>Is there any documentation on the libvoice out there?
<PRE>--
Eric Plaster Image Manipulation Systems
Software Engineer (612)753-5602 x117
plaster@imageman.com www.imageman.com</PRE>
</HTML>
--------------909ED3C638EEEED842FC4CDB--