Extracting a Wave Stream From a Data Set Example for Visual Basic
Function GetWaveFileFromDataSet(objDataSet As LEADDicomDS, _
sResultingWaveFilename As String) As Boolean
GetWaveFileFromDataSet = False
' Do we have any waveforms in the Data Set?
If objDataSet.GetWaveformGroupCount () < 1 Then
Exit Function
End If
Dim objAudioWaveformGroup As New DicomWaveformGroup
objAudioWaveformGroup.EnableMethodErrors = False
' Extract the first waveform group
If objDataSet.GetWaveformGroup (0, objAudioWaveformGroup) <> DICOM_SUCCESS Then
Exit Function
End If
' Extract the wave stream from the waveform group and save it to disk
If objAudioWaveformGroup.SaveAudio (sResultingWaveFilename) <> DICOM_SUCCESS Then
Exit Function
End If
GetWaveFileFromDataSet = True
End Function