Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends...

Can any one say how to find the playlength of the DSS audio file .

The audio file is in the DSS format .

Pls help me to find the playlength of DSS file...


Thanks in advance ,

Mani.
Posted
Comments
raju melveetilpurayil 12-Jul-10 13:31pm    
did you try ffmpeg.exe?

if you not tried ffmpeg check this
FFMPEG All in One Video & Audio Converter Interface[^]
 
Share this answer
 
Hi !

I know this is a very very old post, but it's well referenced in google. So I publish my solution.

Just make some reverse engineering on the DSS and DS2 file format for extract the information like this :

C#
public static TimeSpan GetDssDuration(string fileName)
 {
     const int durationOffset = 62;
     const int durationLength = 6;
     const int headerLength = durationOffset + durationLength;

     using (var fileStream = File.OpenRead(fileName))
     {
         var fileHeader = new byte[headerLength + 1];
         fileStream.Read(fileHeader, 0, headerLength);

         var hoursData = new byte[2];
         var minutesData = new byte[2];
         var secondsData = new byte[2];

         Array.Copy(fileHeader, durationOffset, hoursData, 0, 2);
         Array.Copy(fileHeader, durationOffset + 2, minutesData, 0, 2);
         Array.Copy(fileHeader, durationOffset + 4, secondsData, 0, 2);

         return new TimeSpan(int.Parse(Encoding.ASCII.GetString(hoursData)), int.Parse(Encoding.ASCII.GetString(minutesData)), int.Parse(Encoding.ASCII.GetString(secondsData)));
     }
}


I hope this will help someone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900