Finding and Adding Alert Sounds

One of the Newton 2.x OS Q&As
Copyright © 1997 Newton, Inc. All Rights Reserved. Newton, Newton Technology, Newton Works, the Newton, Inc. logo, the Newton Technology logo, the Light Bulb logo and MessagePad are trademarks of Newton, Inc. and may be registered in the U.S.A. and other countries. Windows is a registered trademark of Microsoft Corp. All other trademarks and company names are the intellectual property of their respective owners.


For the most recent version of the Q&As on the World Wide Web, check the URL: http://www.newton-inc.com/dev/techinfo/qa/qa.htm
If you've copied this file locally, click here to go to the main Newton Q&A page.
This document was exported on 7/23/97.


Finding and Adding Alert Sounds (1/23/97)

Q: Is there a way to add a new sound to the list of available alert sounds?

A: Yes. There is a registry API for alert sounds that is not mentioned in the Newton 2.0 OS final documention. Alert sounds are sound frames with an additional userName slot. This slot contains a string that will show up in the alert sound picker.

RegSound(soundSymbol, alertSoundFrame)

soundSymbol - a unique symbol identifying the sound that incorporates your signature
alertSoundFrame - see above
Registers the sound in alertSoundFrame with the alert sound picker.


UnRegSound(soundSymbol)

soundSymbol - symbol of the sound to unregister
Unregisters the sound frame that was registered with the symbol specified by soundSymbol.


SoundList()

Returns an array of currently registered alert sounds that can be used to construct a popup menu. It returns an array of frames, such that each frame is of the format: {item: soundName, soundSymbol: theSoundSymbol}


GetRegisteredSound(soundSymbol)

soundSymbol - symbol of the sound to return
Returns a sound frame that can be passed to the sound playing functions (for example, the global function PlaySound). soundSymbol is the symbol used to register the sound.