L_DicomWaveGrpLoadAudio

#include "Ltdic.h"

L_UINT16 EXT_FUNCTION L_DicomWaveGrpLoadAudio(hDICOMWaveFormGroup, pszFilename, uFlags)

HDICOMWAVEFORMGROUP hDICOMWaveFormGroup;

/* a DICOM waveform group handle*/

L_CHAR * pszFilename;

/* file name */ 

L_UINT16 uFlags;

/* reserved for future use */

Inserts an audio (wave) file into the waveform group.

Parameter

Description

hDICOMWaveFormGroup

A DICOM waveform group handle

pszFilename

Name of the audio file to load.

uFlags

Reserved for future use. Pass 0.

Returns

0

The function was successful.

> 0

An error occurred. Refer to Return Codes.

Comments

This function is mainly intended to be used with 8-bit (mono and stereo) PCM, mu-Law and a-Law wave files. It can also be used with 16-bit (mono and stereo) PCM wave files, but in this case it will automatically convert them to 8-bit. Please note that this is a limitation in the DICOM standard and not in the function itself.

This function fails and returns DICOM_ERROR_FORMAT if the format of the input wave file is not PCM, mu-Law or a-Law.

This function is very useful when creating DICOM objects of type "Basic Voice Audio" (1.2.840.10008.5.1.4.1.1.9.4.1), which is typically used for report dictation. Two of the main constraints of this IOD are the sampling frequency, which should be 8000; and sample interpretation, which should be unsigned 8-bit linear, 8-bit mu-law or 8-bit A-law. For more information about this object, refer to "Basic Voice Audio Information Object Definition" and "Basic Voice Audio IOD Content Constraints" in the DICOM standard.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_DicomWaveGrpSaveAudio

Topics:

Working with DICOM Waveforms

 

 

Example

//This sample shows how to insert a wave stream into a dataset

BOOL InsertWaveFileIntoDataset(HDICOMDS hInputDS, L_CHAR * pszInputWaveFileName)

{

   HDICOMWAVEFORMGROUP hDICOMWaveFormGroup = NULL;

 

   // Our new waveform group

   hDICOMWaveFormGroup = L_DicomWaveGrpCreate();

   if(hDICOMWaveFormGroup == NULL)

   {

      return FALSE;

   }

         

   // Load an audio file into the waveform group.

   if(L_DicomWaveGrpLoadAudio(hDICOMWaveFormGroup,pszInputWaveFileName,0) != DICOM_SUCCESS)

   {

      L_DicomWaveGrpFree(hDICOMWaveFormGroup);

      return FALSE;

   }

   // Insert the waveform group into the dataset

   if(L_DicomAddWaveformGroup(hInputDS,hDICOMWaveFormGroup, 0,ELEMENT_INDEX_MAX) != DICOM_SUCCESS)

   {

      L_DicomWaveGrpFree(hDICOMWaveFormGroup);

      return FALSE;   

   }

   L_DicomWaveGrpFree(hDICOMWaveFormGroup);

   return TRUE;

}