[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Q: Setting pitch in speech-manager
- To: info-mcl@cambridge.apple.com
- Subject: Q: Setting pitch in speech-manager
- From: Michael O'Donnell <mick@ee.su.oz.au>
- Date: Thu, 14 Oct 1993 18:17:40 +1000
I am trying to write a function to set the default-voice pitch for the
speech-manager. However, lacking experience with traps and pointers,
I am horribly confused. The following are the trap definitions
from the library source 'speech.lisp':
(deftrap _GETSPEECHPITCH ((CHAN (:POINTER :SIGNED-LONG)) (PITCH :POINTER))
(:STACK :SIGNED-INTEGER)
(:STACK-TRAP #xA800 :D0 (+ (ASH 1104 16) 12) CHAN PITCH))
(deftrap _SETSPEECHPITCH ((CHAN (:POINTER :SIGNED-LONG)) (PITCH :SIGNED-LONG))
(:STACK :SIGNED-INTEGER)
(:STACK-TRAP #xA800 :D0 (+ (ASH 1100 16) 12) CHAN PITCH))
The first trap is easy to code for: the following seems to work:
(in-package :speech)
(defun get-speech-pitch nil
(rlet ((Pitch :SIGNED-LONG))
(traps::_GETSPEECHPITCH speech::*Default-Speech-Channel* Pitch)
(%get-signed-word Pitch)))
;(get-speech-pitch) => 43 (male voice) 64 (feamle voice)
I can't get a set-speech-pitch function to work. I tried many variations
on the following:
(defun set-speech-pitch (pitch)
(traps::_SETSPEECHPITCH *Default-Speech-Channel* Pitch))
;(set-speech-pitch 55)
;(get-speech-pitch) => 1
Can someone tell me what I am doing wrong? Thanks for any help,
Mick O'Donnell
University of Sydney