[comp.lang.pascal] What's wrong with this Pascal program?

myb@cernvax.cern.ch (michel bornand) (05/24/91)

Hi everybody! Here is a simple Pascal program for Apple IIGS which should
produce a sound at 16kHz. It does not work. What's wrong with it?
What did I miss?


program testsound;

uses types,sound;

var oneangle:array[1..16] of byte;
    gsoundparms:SoundParamBlock;

begin

     oneangle[1]:=$40;
     oneangle[2]:=$50;
     oneangle[3]:=$60;
     oneangle[4]:=$70;
     oneangle[5]:=$80;
     oneangle[6]:=$90;
     oneangle[7]:=$A0;
     oneangle[8]:=$B0;
     oneangle[9]:=$C0;
     oneangle[10]:=$B0;
     oneangle[11]:=$A0;
     oneangle[12]:=$90;
     oneangle[13]:=$80;
     oneangle[14]:=$70;
     oneangle[15]:=$60;
     oneangle[16]:=$50;

     gsoundparms.waveStart:=@oneangle;
     gsoundparms.waveSize:=16;
     gsoundparms.freqOffset:=311;
     gsoundparms.DOCBuffer:=1;
     gsoundparms.bufferSize:=$0800;
     gsoundparms.nextwave:=@gsoundparms;
     gsoundparms.volSetting:=255;

     FFStartSound($0A01,@gsoundparms);

end.

Thank you for all suggestions.

Micky

Jeff Boyd <BOYDJ@QUCDN.QueensU.CA> (05/24/91)

Most humans can't hear 16kHz. When you get your code working, what
sort of device will you be using to sense the output ?