dmSetAudioDefaults(3dm) dmSetAudioDefaults(3dm)
NAME
dmSetAudioDefaults, dmAudioFrameSize - parameters for digital-media audio
SYNOPSIS
#include <dmedia/dmaudio.h>
DMstatus dmSetAudioDefaults
( DMparams* params,
int width,
double rate,
int channels )
sizet dmAudioFrameSize( const DMparams* params )
DESCRIPTION
dmSetAudioDefaults sets up a parameter list with all of the necessary
parameters to describe audio for the digital-media libraries. The
parameters that are set and their values are: DMMEDIUM = DMAUDIO,
DMAUDIOWIDTH = width, DMAUDIOFORMAT = DMAUDIOTWOSCOMPLEMENT,
DMAUDIORATE = rate, DMAUDIOCHANNELS = channels, DMAUDIOCOMPRESSION
= DMAUDIOUNCOMPRESSED.
dmSetAudioDefaults returns DMSUCCESS if there was enough memory
available to set up the parameters, and DMFAILURE if not.
dmAudioFrameSize takes an audio parameter list and returns the number of
bytes needed to store one frame (one sample from each channel).
EXAMPLE
DMparams* audioParams;
if ( dmParamsCreate( &audioParams ) != DM_SUCCESS ) {
printf( "Out of memory.\n" );
exit( 1 );
}
if ( dmSetAudioDefaults( audioParams,
16, /* width (in bits/sample) */
22050, /* sampling rate */
2 /* # channels (stereo) */
) != DM_SUCCESS ) {
printf( "Out of memory.\n" );
exit( 1 );
}
printf( "%d bytes per frame.\n",
dmAudioFrameSize( audioParams ) );
dmParamsDestroy( audioParams );
SEE ALSO
dmParams(3dm), dmSetAudioDefaults(3dm).
Page 1