Creates an audio (wave) file from the channels in the waveform group.
#include "Ltdic.h"
L_LTDIC_API L_UINT16 L_DicomWaveGrpSaveAudio(hDICOMWaveFormGroup, pszFilename, uFlags)
A DICOM waveform group handle.
Name of the audio file to be created.
Reserved for future use. Pass 0.
Value | Meaning |
---|---|
DICOM_SUCCESS | The function was successful. |
> 0 | An error occurred. Refer to Return Codes. |
This function is very useful for extracting audio (wave) data from a DICOM object of type "Basic Voice Audio" (1.2.840.10008.5.1.4.1.1.9.4.1), which is typically used for report dictation.
The resulting wave file has the following characteristics:
Win32, x64, Linux.
The following sample shows how to extract a wave stream from a dataset.
BOOL GetWaveFileFromDataset(HDICOMDS hInputDS, L_CHAR * pszResultingWaveFileName)
{
HDICOMWAVEFORMGROUP hAudioWaveformGroup = NULL;
// Our new waveform group
hAudioWaveformGroup = L_DicomWaveGrpCreate();
if (hAudioWaveformGroup == NULL)
{
return FALSE;
}
// Do we have any waveforms in the dataset?
if (L_DicomGetWaveformGroupCount(hInputDS) < 1)
{
L_DicomWaveGrpFree(hAudioWaveformGroup);
return FALSE;
}
// Extract the first waveform group
if (L_DicomGetWaveformGroup(hInputDS, 0, hAudioWaveformGroup) != DICOM_SUCCESS)
{
L_DicomWaveGrpFree(hAudioWaveformGroup);
return FALSE;
}
// Extract the wave stream from the waveform group and save it to disk
if (L_DicomWaveGrpSaveAudio(hAudioWaveformGroup, pszResultingWaveFileName, 0) != DICOM_SUCCESS)
{
L_DicomWaveGrpFree(hAudioWaveformGroup);
return FALSE;
}
L_DicomWaveGrpFree(hAudioWaveformGroup);
return TRUE;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document