TSAudioBurner Class


  Name Description
TSAudioBurner() Initializes new instance of the TSAudioBurner class

TSAudioBurner Events

  Name Description
EventHandler ReportProgress Event that reports burning status & progress of discDrive

TSAudioBurner Properties

  Name Description
IDiscRecorder2[] GetDiscDrives() Returns an array of all disc drives
AudioFile LoadAudioFile(string filePath) Loads file from drive and returns an AudioFile

TSAudioBurner Methods

  Name Description
void Burn(IDiscRecorder2 discRecorder, AudioFile[] audioFiles) Burn all audioFiles with specified discRecorder
void Cancel() Cancel Burning

TSAudioBurner Code Example

  // create & initialize TSAudioBurner instance
  TSAudioBurner audioBurner = new TSAudioBurner();
  // initialize the ReportProgress event to recieve burning status
  audioBurner.ReportProgress += currentProgress;
  // retrieve and store all available disc drives
  IDiscRecorder2[] discDrives = audioBurner.GetDiscDrives();

  // store all audio files to burn on disc
  AudioFile[] audioFilesToBurn = new AudioFile[3];
  // load audio files from music folder into audioFilesToBurn array (will throw exception when file doesn't match criteria)
  audioFilesToBurn[0] = audioBurner.LoadAudioFile("C:\\Users\\Thoosje\\Music\\Example1.wav");
  audioFilesToBurn[1] = audioBurner.LoadAudioFile("C:\\Users\\Thoosje\\Music\\Example2.wav");
  audioFilesToBurn[2] = audioBurner.LoadAudioFile("C:\\Users\\Thoosje\\Music\\Example3.wav");

  // burn audio files to disc with specified disc driver
  // note : select proper disc drive beforehand (use data from IDiscRecorder2 in discDrives[] to display drive information in your UI)
  // note : calculate your file sizes beforehand if they will fit on the disc (use audioFilesToBurn[0].SizeOnDisc)
  audioBurner.Burn(discDrives[0], audioFilesToBurn);

TSAudioBurner Code Example (How to report burning progress)

  // pass this method to the TSAudioBurner.ReportProgress event to display burning status
  void currentProgress(object sender, ProgressEventArgs e)
      BurnData data = e.Current;

      Console.WriteLine("Current track number: " + data.currentTrackNumber);
      Console.WriteLine("Eslapsed burning time: " + data.currentTrackNumber);
      Console.WriteLine("Remaining burning time: " + data.currentTrackNumber);

      Console.WriteLine("Current burning action: " + data.currentTrackNumber);
      Console.WriteLine("Start action: " + data.startLba);
      Console.WriteLine("Sector count: " + data.sectorCount);

      Console.WriteLine("Last bytes read count : " + data.lastReadLba);
      Console.WriteLine("Last bytes written count : " + data.lastWrittenLba);

      Console.WriteLine("Total system buffer : " + data.totalSystemBuffer);
      Console.WriteLine("Used system buffer : " + data.usedSystemBuffer);
      Console.WriteLine("Free system buffer : " + data.freeSystemBuffer);