playtime 
Author Message
 playtime

Hello,

Is it possible to get the duration of a wave file with
DirectSound Buffer.

Please advise,

Thanks,

Ravikumar.



Sat, 08 Oct 2005 19:58:31 GMT  
 playtime
Unless you ahve a helper function to do that, you should be able to get this
info from its format.

Check :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dire...
directx/htm/calculatingthedurationofawavsound.asp
(C++ but should be similar for .NET)

--
http://www.chez.com/scribe/en/directx/index.htm



Quote:
> Hello,

> Is it possible to get the duration of a wave file with
> DirectSound Buffer.

> Please advise,

> Thanks,

> Ravikumar.



Sun, 09 Oct 2005 01:59:42 GMT  
 playtime
let N = 1 for 8-bit data or let N = 2 for 16-bit data

DurationInSeconds = FileSizeInBytes / SampleRate / NumberOfChannels / N

Once you load a sound into a secondary buffer, all of this information can
be retrieved by calling DirectSoundSecondaryBuffer8.GetFormat and using the
properties of the WAVEFORMATEX structure that is returned.

--
Bryan Smart - MCSD
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Unless you ahve a helper function to do that, you should be able to get
this
> info from its format.

> Check :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dire...
Quote:
> directx/htm/calculatingthedurationofawavsound.asp
> (C++ but should be similar for .NET)

> --
> http://www.chez.com/scribe/en/directx/index.htm



> > Hello,

> > Is it possible to get the duration of a wave file with
> > DirectSound Buffer.

> > Please advise,

> > Thanks,

> > Ravikumar.



Tue, 18 Oct 2005 22:49:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Playtime of a .wav file

2. Wrong playtime for Variable Bit Rate MP3's.

 

 
Powered by phpBB® Forum Software