0

in My application, i read .DSS format audio Files into Byte Array,with following code

 byte[] bt = File.ReadAllBytes(Filepath);

but i am unable to get data into Byte's. but In the Audio player it is playing , here how can i read the files into Byte Array.

Here i am attaching Snap, what bt have, it show's 255 for all bytes.

enter image description here

TIA

2 Answers2

0

To ensure this is not the issue with File.ReadAllBytes, try to read file using stream, like this:

using (var fileStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
{
   byte[] buffer = new byte[fileStream.Length];
   fileStream.Read(buffer, 0, (int) fileStream.Length);
   // use buffer;
}

UPDATE: as it's not working too, there should be issue with your file. Try to find any process that may be blocking and using it at the moment. Also, try to open the file with any HEX editor and see if there really any meaningful data present. I'd also create clean testing app/sandbox to test if it's working.

grafgenerator
  • 679
  • 7
  • 13
  • hi @grafgenerator , i tried this scenario also,and i get same result,what in Snap. –  Nov 15 '16 at 05:52
  • Try to do 2 things: 1) close any other applications if they're using your file, audio player f.e., 2) try to open the file in any HEX editor and see if it really contains data, not those 0xff. – grafgenerator Nov 15 '16 at 05:54
0

Well, the Dss format is copyrighted, and you'll likely not find a lot of information about it.

255 or 0xFF is commonly used in Dss files to indicate that a byte is not in use. You will see many of them in the header of the Dss file, later in the audio part they will be more sparse.

That means: a value of 255 in the region of bytes 83-97 which you show does NOT mean that something went wrong.

Bernhard Hiller
  • 2,163
  • 2
  • 18
  • 33