Extracting a Wave Stream From a Data Set Example for C#

public bool GetWaveFileFromDataSet(ref LTDICLib.LEADDicomDS objDataSet, ref string sResultingWaveFilename)
{
   bool tempGetWaveFileFromDataSet = false;
   tempGetWaveFileFromDataSet = false;
   // Do we have any waveforms in the Data Set?
   if (objDataSet.GetWaveformGroupCount() < 1)
      return tempGetWaveFileFromDataSet;
   LTDICLib.DicomWaveformGroup objAudioWaveformGroup = new LTDICLib.DicomWaveformGroup(); objAudioWaveformGroup.EnableMethodErrors = false;
   // Extract the first waveform group
   if (objDataSet.GetWaveformGroup(0, objAudioWaveformGroup) != (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
      return tempGetWaveFileFromDataSet;
   // Extract the wave stream from the waveform group and save it to disk
   if (objAudioWaveformGroup.SaveAudio(sResultingWaveFilename, 0) != (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
       return tempGetWaveFileFromDataSet;
   return true;
}