Extracting a Wave Stream From a Data Set Example for C++ 6.0 and later
BOOL GetWaveFileFromDataSet(ILEADDicomDSPtr& spDataSet, LPCSTR pszResultingWaveFilename)
{
// Do we have any waveforms in the Data Set?
if (spDataSet->GetWaveformGroupCount () < 1)
{
return FALSE;
}
IDicomWaveformGroupPtr spAudioWaveformGroup(__uuidof(DicomWaveformGroup));
spAudioWaveformGroup->EnableMethodErrors = VARIANT_FALSE;
// Extract the first waveform group
if (spDataSet->GetWaveformGroup (0, spAudioWaveformGroup) != DICOM_SUCCESS)
{
return FALSE;
}
// Extract the wave stream from the waveform group and save it to disk
if (spAudioWaveformGroup->SaveAudio (pszResultingWaveFilename, 0) != DICOM_SUCCESS)
{
return FALSE;
}
return TRUE;
}