Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.73 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'
  2. FMT fmt=new FMT();    
  3.  
  4. public void ReadFmtHeader()
  5. {
  6.     fmt.s_Sub_Chunk_ID_1 = reader.ReadBytes(4);
  7.     fmt.ui_Sub_Chunk_Size_ID_1 = reader.ReadBytes(4);
  8.     fmt.us_Audio_Format = reader.ReadBytes(2);
  9.     fmt.us_Num_Channels = reader.ReadBytes(2);
  10.     fmt.ui_Sample_Rate = reader.ReadBytes(4);
  11.     fmt.ui_Byte_Rate = reader.ReadBytes(4);
  12.     fmt.us_Block_Align = reader.ReadBytes(2);
  13.     fmt.us_Bits_Per_Sample = reader.ReadBytes(2);
  14.  
  15.     if (Convert.ToInt32(fmt.ui_Sub_Chunk_Size_ID_1) == 18)// Exception thrown on this line
  16.     {
  17.         // Read any extra values
  18.         int fmtExtraSize = reader.ReadInt16();
  19.         reader.ReadBytes(fmtExtraSize);
  20.     }
  21. }