Discussion:
what controls the sample rate when sending speech samples.
(too old to reply)
rtr
2005-09-16 01:00:56 UTC
Permalink
I've got a small app that has all of my A-Law speech samples buffered.
If I use CAPI to deliver the samples do I have to introduce timing as
to not send the samples too quickly?

e.g.
while (my buffer not empty)
send (buffer + offset, chunk)
...

or

while (my buffer not empty)
delay(20000) /* 20ms delay */
send (buffer + offset, 160)
...

I should note that I'm using capi through a higher level interface that
allows chaining of the data passed. The net result of this is that
several B3_DATA_REQ's may be sent before the first B3_DATA_CONF's are
received. Is this not okay? or is the timing introduced between the
B3_DATA_REQ and waiting for the B3_DATA_CONF's?
Jan Wagner
2005-09-16 08:32:03 UTC
Permalink
Post by rtr
I should note that I'm using capi through a higher level interface that
allows chaining of the data passed. The net result of this is that
several B3_DATA_REQ's may be sent before the first B3_DATA_CONF's are
received. Is this not okay?
It is ok, and http://www.capi.org/download/capi20-1.pdf page 44 says
"COMMON-ISDN-API supports up to seven unconfirmed DATA_B3_REQ
messages." You could keep a counter.
Post by rtr
or is the timing introduced between the
B3_DATA_REQ and waiting for the B3_DATA_CONF's?
When the CAPI driver sees that the situation gets too hot, it should
automatically delay the B3_DATA_CONF's (at least if the driver is
well written). The CAPI specs don't say anything about _CONF meaning
the data has actually been sent, so I wouldn't count on it to give
you any true timing help.

The simplest method for sending is probably that at the very start
you send 3-5 REQ's, and then after each received data _CONF you send
a new _REQ.

- Jan
Werner Henze
2005-09-16 19:28:16 UTC
Permalink
Hi!

The easiest way to keep the CAPI send queue running is:
1. upon start of connection start sending N blocks of data (N >= 2)
2. upon receiving a DATA_B3_CONF send the next block of data
The DATA_B3_CONFs give you a good timing/triggering.

If you are sending data received from a sound card, you will need
to synchronize the two clocks.

If you have a high level interface that allows chaining of the
data passed, you can send a lot of DATA_B3_REQs at once. But how
this works exactly depends on the high level interface you use.

Ciao,
Werner...
--
PGP 8 available
http://home.arcor.de/werner.henze
Loading...