Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 7 - Sound / Sound Reference
Functions /


PlaySoundEffect

PlaySoundEffect(soundFrame, volume, type)

Plays a sound effect asynchronously, if the user preferences allow the type of effect.

soundFrame
The sound frame to be played. For details, see "Sound Frame". Or you can specify a binary object of the class 'TDTMFCodec, which contains synthesizer data. In this case, the synthesized sound is played by the synthesizer codec.

volume
The volume at which to play the sound. If you specify nil, the system volume is used.

type
Can be one of the symbols 'pen, 'alarm, or 'action, identifying what type of sound effect this is.

return value
Undefined; do not rely on it.

DISCUSSION

The sound is played only if the user preferences allow sounds of the specified type. For example, if the user preference setting turns off pen sound effects, and type is 'pen, then the sound is not played.

This function is preferred to all other versions of *PlaySound for playing sound effects. If the sound you want to play is not one of the three types of sound effects, then it's best to use a different function for playing sounds.

If type is not 'pen, 'alarm, or 'action, then the sound is played at the specified volume (the same as PlaySoundIrregardlessAtVolume). After this function executes, the volume is reset back to the level it was at before this function executed; that is, the system volume is not permanently changed.

When passed a binary object of the class 'TDTMFCode, and containing synthesizer data, *PlaySoundEffect is a shortcut for invoking the synthesizer codec to play the sound. This shortcut works for the whole family of *PlaySoundxxx functions.

Note that *PlaySoundEffect is not a new function in the Newton 2.1 OS. It is documented in Newton Programmer's Reference, but is duplicated here with some clarification.

SEE ALSO

For more information about using the synthesizer codec, see "Synthesizing Sound". For more information about the format of synthesized sound data, see "Synthesized Sound Data Format".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help