  '=================================
  'ATTACHING SAPI VOICE TO AN OBJECT
  '=================================
  '
  '
  '         ###############
  '       ###################
  '      ###               ###
  '     ###    ###          ###
  '    ###    ## ##         ###
  '    ###   ##   ##        ###
  '    ###  ##     ##       ###
  '    ###  ##      ##      ###
  '    ###  ##      ##      ###
  '    ###   ####  ##      ###
  '     ###    ####       ###
  '      ###             ###
  '       ###           ###
  '         #############
  '           #########

  uses COM/Voice
  CoInitialize null
  Connect voice

  extern

  '---------
  class mind
  '=========
  wstring memory
  end class    

'#recordof ispvoice
'#recordof mind

  '-----------
  class person
  '===========
    has mind
    sys a,b
    '
    method learn(string s)
    '=====================
    memory+=s
    end method
    '
    method recall()
    '==============
    ispVoice*v
    @v=@voice
    if @v 
      v.speak memory
      v.WaitUntilDone forever
    else
      print memory
    endif
    end method
    '
  end class

  '#recordof mind
  '#recordof person
  
  end extern


  CoInitialize null
  Connect voice
  '
  if err then
    print "SAPI Error " hex(Err)
    jmp fwd done
  end if

  '---------
  sub main()
  '=========
  person Hilda
  Hilda.learn "Greeting: Hello Everyone"
  Hilda.recall
 end sub

  main

  Disconnect voice


  '====
  done:
  '====

  Couninitialize



