Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Audio truncated when stopping RTP stream

Status
Not open for further replies.

tony321

Programmer
Apr 3, 2003
1
US
Hi,

I'm trying to write a simple voice over IP application but I'm having trouble with the timing of the audio streams when starting and stopping them. When the user holds down the transmit button I want mic audio to be captured and transmitted (using RTP) until the user releases this button. The problem is that as soon as the user releases the button, I stop the Processor that is handling this audio and the RTP stream stops transmitting immediately. The audio that was just captured before the user released the transmit button has not yet been encoded and transmitted so it is truncated. Even worse, the next time this user presses the transmit button, the last half-second or so of his previous transmission is finally processed and sent before the new audio is captured.

I've tried doing the starting/stopping at different places (the input data source that captures the audio, the Processor that encodes it, and the RTP SendStream) but the result is always the same. The only workaround I was able to come up with was to delay for about half a second before stopping the audio when the user releases the transmit button. This is a pretty lousy hack though since the actual amount of time I should delay would vary from machine to machine depending on how long it takes to encode the captured audio. If anyone knows a better solution to this (some way that I could stop capturing audio but finish transmitting the audio already in the pipeline) I would REALLY appreciate
it. Thanks,

-Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top