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

.NET (Core and Framework)

 
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 
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 
Andrey U wrote:
I know that the play position affects the output, but in my real application I receive packets and I can't wait.
I use PlayPosition property only for finding out what happens, so I don't rely on it.


Yes, but when you call "SetCurrentPosition" you're moving the play cursor, which will cause jumps / glitches in your audio output. If you're playing at the same rate you're receiving data (which you should be) then you should be able to let the buffer play continually without having to move the cursor.


Andrey U wrote:
I've tried different types of buffering and the only way to improve the output is to use bigger buffer, but this means more latency...


Well, your buffers are very small, and about 40ms (1/25th sec) long. For a voice chat or VoIP application you should be able to go up to 100ms or even 200ms without any problem. Nobody is going to notice those kinds of delays in voice only communications.

I'm not sure why you're getting popping on playing empty buffers - if you've zero-filled them they should play silence. Starting and stopping waves which aren't on zero-crossings can cause pops, but dealing with that is another matter.


Andrey U wrote:
I've just read in another forum that this problem migth be caused by "The Windows resampler", which works better at certain rates and bad at 8 kHz. But how could I avoid this?


There shouldn't be any problem playing at 8 KHz, and I've just run a quick test in my app which works fine. It sounds pretty bad playing music, but it does play smoothly. I suspect your problems are more to do with your Sleep timer and moving the play cursor.

I'd go for something more like :-

while (stillPlaying)
{
    CheckForInputData();

    playPos = GetCurrentPosition();

    if (playPos just crossed half-buffer)
    {
        FillOtherHalfBuffer();    // hopefully data has arrived, if not more complex logic needed
    }

    Sleep(10);    // some short-ish time
}


There are three kinds of people in the world - those who can count and those who can't...

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 
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 

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.