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

.NET (Core and Framework)

 
AnswerRe: XML Serialization Problem with properties that when set change object status [modified] Pin
Moreno Airoldi3-Jun-09 1:35
Moreno Airoldi3-Jun-09 1:35 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Sebastian Streiger3-Jun-09 2:23
Sebastian Streiger3-Jun-09 2:23 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Moreno Airoldi3-Jun-09 3:03
Moreno Airoldi3-Jun-09 3:03 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Sebastian Streiger3-Jun-09 3:22
Sebastian Streiger3-Jun-09 3:22 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Moreno Airoldi3-Jun-09 22:36
Moreno Airoldi3-Jun-09 22:36 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Sebastian Streiger4-Jun-09 4:40
Sebastian Streiger4-Jun-09 4:40 
GeneralRe: XML Serialization Problem with properties that when set change object status Pin
Moreno Airoldi4-Jun-09 4:47
Moreno Airoldi4-Jun-09 4:47 
QuestionPlaying smoothly small pieces with DirectSound Pin
Andrey U2-Jun-09 0:09
Andrey U2-Jun-09 0:09 
Hi
I have a problem. I am developing a VoIP application using DirectSound to capture and play voice. Everything is OK with the capturing, but I can't play the received data smoothly when it is a small piece. It should be small for preventing latency. Currently I capture 320 bytes and send it via UDP. The wave format is 8000 Hz and 8000 B/S.
For reproducing the problem I use the following code:


int step = 320, c = 0, N = 2;
offset = data.Length % step;

// (SecondaryBuffer) buf size is N * step;
buf.Play(0, BufferPlayFlags.Looping);

byte[] smallArr = new byte[step];

double sleep = (double)step / waveFormat.AverageBytesPerSecond * 1000;

//data is a captured sound saved to a file previously
while (data.Length > offset)
{
buf.SetCurrentPosition(((c + 1) % N) * step);

Array.Copy(data, offset, smallArr, 0, step);
buf.Write(c*step, smallArr, LockFlag.None);
Thread.Sleep((int)sleep);
offset += step;
c++;
c%=N;
}


While debugging I found out that the PlayPosition cursor doesn't reach the expected point. I move it forward and the result is that not all data is played and the sound is not smooth.


There is no problem when the playing portion is bigger but I can't afford latency.
When I use a lot higher quality(and play bigger portion of data) there is no problem again but the traffic is large!
I can't use more than one buffers because the noise is awful when play/stop/mute.


So, would you help me to solve the problem with the playing buffer?

Thank you in advance!
AnswerRe: Playing smoothly small pieces with DirectSound Pin
molesworth2-Jun-09 3:31
molesworth2-Jun-09 3:31 
GeneralRe: Playing smoothly small pieces with DirectSound Pin
Andrey U2-Jun-09 4:18
Andrey U2-Jun-09 4:18 
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 
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 

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.