Re: Questions on Recording from a Call

Richard Deadman <[email protected]> Fri, 1 Apr 2005 00:27:42 -0500
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <[email protected]>
Dan,

See some thoughts below. Note that this implies a perfect implementation
of the JTAPI 1.3 media interfaces. They are extremely complex, so many
implementations may not satisfy all the constraints and requirements.
JTAPI 1.2 media support used asynchronous simpler methods on a
MediaTerminalConnections that don't allow for silence truncation or
detection at all.

Cheers,


Richard

Dan Bizman wrote:

>1. How do I start recording the caller's voice immeadiately and stop when
>there's a pause?
>
>The problem is that when I go to record, say for 5 seconds, sometimes it
>starts grabbing sound right away, thus recording the first 5 seconds.
>Sometimes, however, it takes a second before everything kicks in and so it
>misses the beginning of what they say and records only 2-3 seconds worth
>since the timer still stops after 5 seconds.
>
>The problem with this is if they start speaking right after the beep, it
>doesn't always capture the first few seconds of sound. Any idea what to do?
>What might be happening? Has anyone else experienced this?
>
>
JTAPI 1.3's media services defines a recorder method that takes both an
array or RTCs (Run Time Controls) and a dictionary of optional
arguments. The optargs dictionary can contain keys p_MaxDuration, with a
value in the dictionay stating the maximum record length.
p_SilenceTruncationOn and p_SilenceTruncationThreshold should allow you
to eliminate silences larger than a specific length from the recording.
Finally, p_SilenceTerminationOn and p_SilenceTerminationThreshold should
allow you to specify when to assume that the person has stopped talking.
The attribute a_Beep specifies to play a beep before recording.

One RTC that can be passed to the Recorder.record() method is
RTC.SigDet_StopRecord. If the array of RTCs contains this then the
recording should stop when a DTMF signal is detected.

>
>2. How do I have my program listen for input at the same time as playing
>a .wav file?
>
>
Here you would need a MediaService that supports both Player and
SignalDetector. You then need to set a Dictionary item on the
MediaService with the key p_Mode and the value v_Detecting. This tells
the MediaService to detect signals. You can then set a pattern matcher
to trigger an RTC. Then, when you issue the Player.play() command, you
include an RTC such that when a signal is detected playing stops.

>For example, when I call Sprint customer service, they play a recording
>saying, "For PCS phones say 1, for billing say 2, for..." and if during
>this I say "2" it will stop the recording and evaluate what I've said. So
>obviously it's both sending and receiving voice data. Can I do this with
>JTapi? How?
>
>
This is more difficult. You might need two threads running, one with
play and one with record, and have the record return once something is
heard. The record thread would then trigger an RTC on the player to stop
playing. You would need to hope that loopback noise doesn't cause the
recorder to hear the player.

>Thanks!
>
>===========================================================================
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff JTAPI-INTEREST".  For general help, send email to
>[email protected] and include in the body of the message "help".
>
>
>

--
Richard Deadman
Deadman Consulting, Inc.
Web Services, Policy Management, Java Telephony, Software Architecture
mailto:[email protected]
http://www.deadman.ca
Office: 613-231-5112
Cell: 613-220-2469

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".