FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SOUND

Use MyHalveFreq


CLEAR LOCAL
  DIM myRate&
  DIM mySndCmd.sndCSize
  DIM myErr
LOCAL FN MyHalveFreq (mySndChan&)
'Get the rate of the sample currently playing.
  mySndCmd.cmd% = _getRateCmd ' the command is getRateCmd}
  mySndCmd.param1% = 0 ' unused}
  mySndCmd.param2& = @myRate&
  myErr = FN SndDoImmediate(mySndChan&, mySndCmd)
  LONG IF myErr = noErr
' Halve the sample rate
    mySndCmd.cmd% = _rateCmd ' the command is rateCmd
    mySndCmd.param1% = 0 ' unused
    mySndCmd.param2& = FN FixDiv(myRate&, &H00020000)
    myErr = FN SndDoImmediate(mySndChan&, mySndCmd)
  END IF
END FN = myErr

untested, but should work.

Chris Young