private void ExtractMp3() { SWF swfParser = new SWF(fullPath + ".swf"); swfParser.ReadHeader(); byte[] tmp; //byte[] mp3 = ""; TagInfo info; FileStream myFStream = new FileStream(fullPath + ".mp3", FileMode.Create, FileAccess.Write); do { info = swfParser.ReadTag(); if (info.Size > 0) { tmp = swfParser.ReadBytes((int)info.Size); if (info.Id == 19) { myFStream.Write(tmp, 4, tmp.Length - 4); //Console.WriteLine(BitConverter.ToString(tmp)); } } }while (info.Id > 0); //TextWriter tw = new StreamWriter(@"C:\test.mp3"); //tw.Write(mp3); myFStream.Close(); }
public static void ExtractFromSwf(string filePath) { FileStream myFStream = null; try { SWF swfParser = new SWF(filePath + ".swf"); swfParser.ReadHeader(); byte[] tmp; //byte[] mp3 = ""; TagInfo info; myFStream = new FileStream(filePath + ".mp3", FileMode.Create, FileAccess.Write); do { info = swfParser.ReadTag(); if (info.Size > 0) { tmp = swfParser.ReadBytes((int)info.Size); if (info.Id == 19) { myFStream.Write(tmp, 4, tmp.Length - 4); } } } while (info.Id > 0); } catch { throw; } finally { if (myFStream != null) { myFStream.Close(); } } }
public static void ExtractFromSwf(string filePath) { FileStream myFStream = null; try { SWF swfParser = new SWF(filePath + ".swf"); swfParser.ReadHeader(); byte[] tmp; //byte[] mp3 = ""; TagInfo info; myFStream = new FileStream(filePath + ".mp3", FileMode.Create, FileAccess.Write); do { info = swfParser.ReadTag(); if (info.Size > 0) { tmp = swfParser.ReadBytes((int)info.Size); if (info.Id == 19) { myFStream.Write(tmp, 4, tmp.Length - 4); } } }while (info.Id > 0); } catch { throw; } finally { if (myFStream != null) { myFStream.Close(); } } }
private void ExtractMp3() { SWF swfParser = new SWF(fullPath + ".swf"); swfParser.ReadHeader(); byte[] tmp; //byte[] mp3 = ""; TagInfo info; FileStream myFStream = new FileStream(fullPath + ".mp3", FileMode.Create, FileAccess.Write); do { info = swfParser.ReadTag(); if (info.Size > 0) { tmp = swfParser.ReadBytes((int)info.Size); if (info.Id == 19) { myFStream.Write(tmp, 4, tmp.Length - 4); //Console.WriteLine(BitConverter.ToString(tmp)); } } } while (info.Id > 0); //TextWriter tw = new StreamWriter(@"C:\test.mp3"); //tw.Write(mp3); myFStream.Close(); }