Click here to Skip to main content
13,767,889 members
Rate this:
 
Please Sign up or sign in to vote.
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 12-Jul-10 0:59am
Comments
raju melveetilpurayil 12-Jul-10 13:31pm
   
did you try ffmpeg.exe?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

if you not tried ffmpeg check this
FFMPEG All in One Video & Audio Converter Interface[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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 :

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.181116.1 | Last Updated 23 May 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100