Board index » delphi » Low level Multimedia calls: help!!!

Low level Multimedia calls: help!!!

Help!  I am trying to program the 'low level audio waveform' services of the
mmsystem api using delphi 1.0.

I try the following code to open the waveform device:

var
     waveformatptr:pwaveformat;
     thehandle:phWaveOut;
     errmsg:word;
begin
     new(waveformatptr);
     waveformatptr^.wformattag:=WAVE_FORMAT_PCM;
     waveformatptr^.nchannels:=2;
     waveformatptr^.nsamplespersec:=44100;
     waveformatptr^.navgbytespersec:=176400;
     waveformatptr^.nblockalign:=4;
     wordback:=waveoutopen(thehandle,0,waveformatptr,0,0,WAVE_FORMAT_QUERY);

end;

If this worked ok, then wordback should be zero. Unfortunately, it is 11, which translates as:

'MMSYTEM032 the specified format cannot be translated or supppoted use the capabilities
function to view supported formats.'

Now, the 'capability' function is not a pascal-callable  function ( I don't know what it is).

So, can anyone tell me :

        1. Why I get this message, as I am sure that  WAVE_FORMAT_PCM is correct.
        2. How to use the capability function.

Also does anyone know of any web pages that deal with programming using the mmsystem api?

Thanks in advance

Ryan.

 

Re:Low level Multimedia calls: help!!!


On Tue, 04 Feb 97 15:52:40 GMT, Ryan.Mi...@nottingham.ac.uk (Ryan

Quote
Mills) wrote:

Ryan

You need to set the number of bits in the sample ie. 8 or 16

waveformatptr^.wBitsPerSample := 16 ;

hpe this helps
Pete
Sydney, Oz

Quote
>Help!  I am trying to program the 'low level audio waveform' services of the
>mmsystem api using delphi 1.0.

>I try the following code to open the waveform device:

>var
>     waveformatptr:pwaveformat;
>     thehandle:phWaveOut;
>     errmsg:word;
>begin
>     new(waveformatptr);
>     waveformatptr^.wformattag:=WAVE_FORMAT_PCM;
>     waveformatptr^.nchannels:=2;
>     waveformatptr^.nsamplespersec:=44100;
>     waveformatptr^.navgbytespersec:=176400;
>     waveformatptr^.nblockalign:=4;
>     wordback:=waveoutopen(thehandle,0,waveformatptr,0,0,WAVE_FORMAT_QUERY);

>end;

>If this worked ok, then wordback should be zero. Unfortunately, it is 11, which translates as:

>'MMSYTEM032 the specified format cannot be translated or supppoted use the capabilities
>function to view supported formats.'

>Now, the 'capability' function is not a pascal-callable  function ( I don't know what it is).

>So, can anyone tell me :

>    1. Why I get this message, as I am sure that  WAVE_FORMAT_PCM is correct.
>    2. How to use the capability function.

>Also does anyone know of any web pages that deal with programming using the mmsystem api?

>Thanks in advance

>Ryan.

Other Threads