|
|
Choosing A Webhost: |
Re: Problems with the Speex Jitter Buffer: msg#00056audio.compression.speex.devel
David Feurle wrote: > Thanks for your reply Jean-Marc! > > this was what I had before. > But I decided to restructure it since the thread that plays the sound is > a callback from the sound hardware, more or less an interrupt handler. > For me it seems more reasonable to waste some memory for to save the > decompressed Packet. While I write this I begin to think that it is > possible I decompress Packets that are never used because they are too > late. What is the reason why one should put the compressed Packet in the > JitterBuffer? Because otherwise, you end up decoding the packets in random order -- not very useful with a stateful codec! Jean-Marc > David >> (Sorry about the delay -- currently attending ICASSP) >> Hi, >> >> Haven't looked at all the details, but what's clearly wrong is that you >> need to put the *compressed* packets in the jitter buffer and decode >> them only when you _get() them. >> >> Jean-Marc >> >> David Feurle wrote: >> >>> Hi, >>> >>> I am using the JitterBuffer. Since there is not so much documentation I >>> think I dont use it in a correct way. All the packets are recieved (I >>> control the sequence numbers) but the JitterBuffer often tells me he has >>> no packet. I am using it in the following way: >>> >>> I am not sure if I use the ticks correctly but I think it can be set to >>> 20(msec). >>> It is set as a Member in my class and i pointed out where i use it so it >>> is clear if i use it somewhere i better shouldnt. >>> >>> - I initialize the JitterBuffer with ticks = 20 (saved in the variable >>> m_Ticks) >>> - My network thread repeadedly (every 20msec) calls AddPacket() which >>> adds the packet to the buffer >>> 320 bytes of audio data are set as the data >>> the timestamp is set to the sequence number of the packet times >>> 20 (m_Ticks) >>> the span of the packet is set to 20 (the packet covers one tick >>> entirely) >>> - A thread which plays my Audio calls every 20msec the function >>> GetSound() >>> >>> As I said before the buffer just returns more or less the halve of the >>> packets. But all the packets are added to the JitterBuffer. >>> I posted some of the code i use in my email and i would be really >>> thankfull if anybody could tell me where i am using the JitterBuffer >>> wrong. >>> >>> Many thanks in advance >>> >>> David Feurle >>> >>> >>> >>> Init() >>> { >>> m_JitterBuffer = jitter_buffer_init(m_Ticks); >>> jitter_buffer_reset(m_JitterBuffer); >>> } >>> >>> Exit() >>> { >>> jitter_buffer_destroy(m_JitterBuffer); >>> } >>> >>> void BeatJitterBuffer::AddPacket(Packet* packet) >>> { >>> m_Mutex.Aquire(); >>> char buff[320]; >>> JitterBufferPacket p; >>> m_Decoder->DecompressPacket(packet, buff, 320); >>> p.data = buff; >>> p.len = 320; >>> p.timestamp = packet->SequenceNumber() * m_Ticks; >>> p.span = m_Ticks; >>> jitter_buffer_put(m_JitterBuffer, &p); >>> } >>> >>> m_Mutex.Release(); >>> delete packet; >>> } >>> >>> void BeatJitterBuffer::GetSound(char* buffer, size_t maxLength) >>> { >>> int ret; >>> >>> if (320 == maxLength) >>> { >>> JitterBufferPacket packet; >>> packet.data = buffer; >>> >>> m_Mutex.Aquire(); >>> >>> ret = jitter_buffer_get(m_JitterBuffer, &packet, 0); >>> >>> if(ret != JITTER_BUFFER_OK) >>> { >>> ZeroMemory(packet.data, maxLength); >>> } >>> >>> jitter_buffer_tick(m_JitterBuffer); >>> jitter_buffer_update_delay(m_JitterBuffer, &packet, NULL); >>> m_Mutex.Release(); >>> } >>> else >>> { >>> ZeroMemory(buffer, maxLength); >>> } >>> } >>> >>> _______________________________________________ >>> Speex-dev mailing list >>> Speex-dev@xxxxxxxx >>> http://lists.xiph.org/mailman/listinfo/speex-dev >>> >>> > >
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Problems with the Speex Jitter Buffer, Jean-Marc Valin |
|---|---|
| Next by Date: | Re: Problems with the Speex Jitter Buffer, David Feurle |
| Previous by Thread: | Re: Problems with the Speex Jitter Buffer, David Feurle |
| Next by Thread: | Re: Problems with the Speex Jitter Buffer, David Feurle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |