background image
C H A P T E R 1 4
Sound
14-8
Using Sound
clipped off with each new call to the
PlaySoundSync
function. In fact, it's likely
that you won't hear twenty sounds in the asynchronous playback demo; the calls
occur faster than the Newton sound chip can respond.
About the Sound Chip
14
The Newton sound chip requires about 50 milliseconds to load a sound and begin
playing it. It also requires about 50 milliseconds to clear its registers and ready
itself for the next call after playback completes. Although most applications are not
affected by this timing information, it is included for interested developers, along
with the caveat not to rely on the ramp-up and ramp-down times specified here
because they may change in future Newton devices.
Generating Telephone Dialing Tones
14
Applications can use the
Dial
view method and the
RawDial
global function to
generate telephone dialing tones from NewtonScript. It is strongly recommended
that you use these functions rather than attempt to generate dialing tones yourself.
These functions produce dialing tones that meet the standards for all countries in
which Newton devices are available, sparing the application developer the effort of
dealing with widely varying telephone standards.
If you need to perform other actions while generating dialing tones, such as posting
status messages as various parts of the phone number are dialed, you can use the
global function
RawDial
to dial asynchronously. The
RawDial
function accepts
the same arguments as the
Dial
method; however, it dials asynchronously.
Note that both dialing functions map alphanumeric characters to the dialing tones
that a standard telephone keypad produces for these characters. Standard telephone
keypads do not implement the letters Q and Z; the
Dial
method and
RawDial
function map these letters to the tone for the digit 1. Pound (
#
) and asterisk (
*
)
characters are mapped to the same tones that a standard telephone keypad provides
for these characters.
Certain phone systems, such as those used for PBX and military applications, also
generate special tones (DTMF dialing tones) for the letters A­D. Because the
Newton ROM does not generate these special tones, its dialing functions map the
characters
A
,
B
,
C,
and
D
to the tones they generate on a standard telephone keypad.
Advanced Sound Techniques
14
This section describes advanced techniques for manipulating the sound frame or its
playback. The topics discussed include pitch shifting and manipulating sample data
to produce altered sounds.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна