From: then@vipunen.hut.fi (Tomi  H Engdahl)
Subject: Re: Decoding DTMF tones with sb ? Is it possible ?
Organization: Helsinki University of Technology, Finland
	<1992Jul28.102614.21751@ugle.unit.no>
Distribution: alt
Date: 29 Jul 92 20:07:44

In article <1992Jul28.102614.21751@ugle.unit.no> venaas@siri.unit.no (Stig Venaas) writes:

>1. What are the other 4 DTFMs? I know the freqs for them, but I don't
>   know what they are called. Each consists of two sine waves. There
>   are four choises for each of them. I know all the freqs and I know
>   which pairs 0-9 uses, and I can find out which * and # uses. But
>   not the other 4.

I have seen them called A, B, C and D.

>2. I need some info on how to program the SB in order to sample. I
>   could look into the code for vrec, but it's not an easy way of
>   getting the info.

Here is an example code which samples data using soundblaster, 
then modifies the sample data and play it back through JDAC type
D/A converter connected to LPT2.

Program Change_Speech_pitch;
 
 
{ (C) Tomi Engdahl 26.4.1992 }
 
Uses Crt;
 
Const
   BufferLength=400;
   sb_base=$220;
   gameport=$201;
   fm_stat=sb_base;
   fm_addr=sb_base;
   fm_data=sb_base+1;
   afm_stat=sb_base+2;
   afm_addr=sb_base+2;
   afm_data=sb_base+3;
   mixer_addr=sb_base+4;
   mixer_data=sb_base+5;
   DSP_reset=sb_base+6;
 
   DSP_read=sb_base+$A;
   DSP_write=sb_base+$C;
   DSP_wstat=sb_base+$C;
   DSP_rstat=sb_base+$E;
 
   LPT_base=$278;
 
 
Var
   tmp:byte;
   temp:integer;
   buffer:array[0..1,0..BufferLength] of byte;
 
Function Read_SBADC:byte;
Begin
      Inline(
      $BA/$2C/$02/      {MOV     DX,022C    }
      $EC/              {IN      AL,DX      }
      $A8/$80/          {TEST    AL,80      }
      $75/$FB/          {JNZ     0107       }
      $B0/$20/          {MOV     AL,20      }
      $EE/              {OUT     DX,AL      }
      $BA/$2E/$02/      {MOV     DX,022E    }
      $EC/              {IN      AL,DX      }
      $A8/$80/          {TEST    AL,80      }
      $74/$FB/          {JZ      0112       }
      $BA/$2A/$02/      {MOV     DX,022A    }
      $EC/              {IN      AL,DX      }
      $A2/tmp);         {MOV     a,AL       }
      Read_SBADC:=tmp;
End;
 
Procedure reset_DSP;
Begin
   Port[DSP_reset]:=1;
   Delay(1);
   Port[DSP_reset]:=0;
End;
 
Procedure write_DSP(data:byte);
Begin
   Repeat Until (Port[DSP_wstat] and 128)=0;
   Port[DSP_write]:=data;
End;
 
Procedure output_sample(data:byte);
Begin
   {write_DSP($10);
   write_DSP(data);}
   Port[LPT_base]:=data;
End;
 
Procedure set_speaker_on;
Begin
   write_DSP($D1);
End;
 
Procedure set_speaker_off;
Begin
   write_DSP($D0);
End;
 
 
Procedure pitch_up(wbuf,rbuf:integer);
Var
   writep,readp:word;
Begin
   writep:=0;
   readp:=0;
   Repeat
      buffer[wbuf,writep]:=read_SBADC;
      {   Write(buffer[wbuf,writep],'  ');  }
      Inc(writep);
      output_sample(buffer[rbuf,readp]);
      Inc(readp);
      Inc(readp);
   Until readp>=BufferLength;
   readp:=0;
   Repeat
      buffer[wbuf,writep]:=read_SBADC;
   {      Write(buffer[wbuf,writep],'  ');  }
      Inc(writep);
      output_sample(buffer[rbuf,readp]);
      Inc(readp);
      Inc(readp);
   Until readp>=BufferLength;
End;
 
 
Procedure test_ADC;
Begin
   Repeat
      Write(read_SBADC,' ');
   Until KeyPressed;
End;
 
Begin
   reset_DSP;
{   set_speaker_on;
   test_ADC;        }
   For temp:=0 to BufferLengthAT S0=0 S10=20 Q0 E1 X4
AT&C1




--

Tomi.Engdahl@hut.fi            "Don't force it; get a larger hammer"
then@vipunen.hut.fi                        
Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA