Replies: 1 comment
-
The default audio sample period used is 20ms. Other than that there is no buffering in the sipsorcery library. There is no jitter buffer or anything like that. If an application needs buffering it needs to implement it. I've done a lot of testing, for both SIP and WebRTC, with the |
Beta Was this translation helpful? Give feedback.
-
I use SipsorceryMedia.windows to get windows audio in/out device. It's really time saving.
However, there is some lag in the sip call(the gap between audio sent by client & received by server in local network). As my application is really need Real-Time response, I have to check whether there is any possibility to improve the performance. Any solution on how to reduce the latency?
Besides, I noticed one article about the audio buffer listed below. What to understand more about sipsorceryMedia. What's the audio buffer in it? And what's the audio interface it uses?
Thanks a lot.
Typically, latency time is comparable with an audio buffer granularity. For example, if application uses a total buffering time of 500 ms divided into four buffer parts, average application latency time will be 500 / 4 = 125 ms.
To reduce latency time, first try to decrease application's audio buffer granularity. Some MME applications allow to specify number of audio buffers and a total buffering time; set these values to 50..100 ms per buffer part and 500..1000 ms of total time. DirectSound applications also may allow to specify a minimal buffer fragment size for processing.
With a well-tuned configuration (hardware, OS and applications), it is possible to reduce latency time down to several milliseconds. Latency less than 1-2 ms is not possible in Windows because a lowest timing interval is 1 ms.
Here is my code for reference.
winAudio = new WindowsAudioEndPoint(audioEncoder: new AudioEncoder(), audioOutDeviceIndex: audioOutDevIndex,
audioInDeviceIndex: audioInDevIndex, disableSource: false, disableSink: false);
voipMediaSession = new VoIPMediaSession(new MediaEndPoints { AudioSink = winAudio, AudioSource = winAudio });
bool callResult = await userAgent.Call(DESTINATION, null, null, voipMediaSession);
Beta Was this translation helpful? Give feedback.
All reactions