Problem in set Position od a WaveChannel32 object

Aug 12, 2011 at 10:11 PM

hi everyone!

when i set the WaveChannel32 position attibute of my object (x) i do this

x.Position = 119815;
Console.writeline("set position to 119815 = " + x.Position + " (" + x.CurrentTime + ")");
x.Position = 119816;
Console.writeline("set position to 119816 = " + x.Position + " (" + x.CurrentTime + ")");

I hope to reiceive this output

position 119815 = 119815 (00:00:00.34566355)
position 119816 = 119816 (00:00:00.34566379)

instead my output is this...

position 119815 = 129024 (00:00:00.34000000)
position 119816 = 119816 (00:00:00.36600000)

Why after i set position to 119816 it goes to 129024? how can i have a better precision of buffer position?

I tried to use DirectSound, WaveOut and Wasapi (on sharedmode) but the problem persists.

I hope in your help! thanks!

Coordinator
Aug 25, 2011 at 3:41 PM

you have to set the position by the granularity of BlockAlign. What is the underlying WaveFormat?

Aug 25, 2011 at 8:39 PM

are you saying that i can't set an exact position value but only an approximation? I need a better precision than 0.026 second... what do you mean by "What is the underlying WaveFormat?"?

thanks for the answer!

Coordinator
Sep 22, 2011 at 3:49 PM

I mean, are you playing an MP3 file, or some other compressed format?