Click here to Skip to main content
15,887,988 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
molesworth2-Jun-09 6:58
molesworth2-Jun-09 6:58 
AnswerRe: Playing smoothly small pieces with DirectSound Pin
Mark Salsbery2-Jun-09 8:26
Mark Salsbery2-Jun-09 8:26 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
Andrey U2-Jun-09 22:37
Andrey U2-Jun-09 22:37 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
molesworth3-Jun-09 0:58
molesworth3-Jun-09 0:58 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
supercat93-Jun-09 7:07
supercat93-Jun-09 7:07 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
molesworth3-Jun-09 8:47
molesworth3-Jun-09 8:47 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
Mark Salsbery3-Jun-09 9:53
Mark Salsbery3-Jun-09 9:53 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
Mark Salsbery3-Jun-09 9:35
Mark Salsbery3-Jun-09 9:35 
In addition to molesworth's reply...

1:
I use buffer notifications at 25ms intervals and have had no problems with reliability,
especially XP SP2+. (I've heard no complaints on Windows 2000, but I struggled with network
chunkiness on that OS Smile | :) )


2:
jitter handling:
Dropping packets if necessary is fine if the packets are 25ms - that shouldn't be audible.
If you run out of packets, repeating the last packet written works ok. If you want to go crazy, you can
use interpolation to stretch or compress audio data....kinda overkill for voice.

Molesworth mentioned "Your buffer size and the reliability of the connection will determine
how often you get overruns or underruns". There's also clock drift - two PC's clocks do NOT tick
at the same rate - you'll see (hear)! Over (wall clock) time, the buffer cursors at the endpoints are going to
drift apart. You can hear this if you try to just write every byte of every packet sent to the playback buffer -
either the latency will increase over time or the latency will decrease over time. In both
cases playback eventually turns to garbage when the cursors wrap and/or get out of sync with where you're stuffing
the data.


3:
You should only (and only need to) manipulate the play buffer from one thread - the thread that
responds to buffer notifications and stuffs more data in the buffer.


4:
Let the buffer play and always provide data just ahead of the cursor - you shouldn't and don't need
to adjust the play position during playback. A robust jitter buffer implementation should provide data
whenever requested by the playback thread.


Just tips based on years of doing live multimedia streaming code - hopefully helpful.

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Playing smoothly small pieces with DirectSound Pin
molesworth3-Jun-09 22:33
molesworth3-Jun-09 22:33 
QuestionRe: Playing smoothly small pieces with DirectSound Pin
BenjoD10-Aug-09 18:31
BenjoD10-Aug-09 18:31 
Questionproblem solving in MDAC ver2.6 Pin
RAJAGOPALMS761-Jun-09 21:54
RAJAGOPALMS761-Jun-09 21:54 
AnswerRe: problem solving in MDAC ver2.6 Pin
Jimmanuel2-Jun-09 1:17
Jimmanuel2-Jun-09 1:17 
GeneralRe: problem solving in MDAC ver2.6 Pin
RAJAGOPALMS762-Jun-09 18:54
RAJAGOPALMS762-Jun-09 18:54 
QuestionHow to Use Network Sniffer Pin
amit512811-Jun-09 20:57
amit512811-Jun-09 20:57 
AnswerRe: How to Use Network Sniffer Pin
Simon P Stevens1-Jun-09 23:43
Simon P Stevens1-Jun-09 23:43 
Questionclient server communication Pin
yrishi1-Jun-09 19:58
yrishi1-Jun-09 19:58 
AnswerRe: client server communication Pin
rohitissharma2-Jun-09 18:07
rohitissharma2-Jun-09 18:07 
QuestionHow to build an IE toolbar that doesn't require installation Pin
zwlei1-Jun-09 17:23
zwlei1-Jun-09 17:23 
AnswerRe: How to build an IE toolbar that doesn't require installation Pin
leo_5551-Jun-09 19:16
leo_5551-Jun-09 19:16 
QuestionInstalling NETCFv35 in Windows Mobile 6 Classic [modified] Pin
Marije1-Jun-09 0:17
Marije1-Jun-09 0:17 
AnswerRe: Installing NETCFv35 in Windows Mobile 6 Classic Pin
leeky__5-Aug-09 17:59
leeky__5-Aug-09 17:59 
QuestionConverting a mainframe database into Ms-Access using VB.NET Pin
sivakumar.mariappan1-Jun-09 0:04
sivakumar.mariappan1-Jun-09 0:04 
AnswerRe: Converting a mainframe database into Ms-Access using VB.NET Pin
ScottM11-Jun-09 0:35
ScottM11-Jun-09 0:35 
GeneralRe: Converting a mainframe database into Ms-Access using VB.NET Pin
sivakumar.mariappan1-Jun-09 0:57
sivakumar.mariappan1-Jun-09 0:57 
GeneralRe: Converting a mainframe database into Ms-Access using VB.NET Pin
Pete O'Hanlon1-Jun-09 1:33
mvePete O'Hanlon1-Jun-09 1:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.