Apple Newton Utilities User's Guide Page 560

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 559
CHAPTER 14
Sound
14-6 Using Sound
Creating a Sound Channel for Playback 14
You create a sound channel by sending it the Open function.
The code that creates a sound channel for playback might look like the
following example:
mySndChn := {_proto:protoSoundChannel};
mySndChn:Open();
Playing Sounds 14
Once you create the sound channel, you can use any of the following methods to
control the sound.
Schedule—queues the sound for play.
Start—starts playing the sounds in the order that they were scheduled.
Stop—stops all scheduled sounds including currently playing sounds, if any.
Pause—temporarily stops the current playback process in the specified
sound channel.
IsPaused—checks to see if the sound channel is paused.
IsActive—checks to see if the sound channel is playing.
Deleting the Sound Channel 14
When nished with the sound channel, you need to dispose of it by sending the
Close message to it. Most applications can dispose of the sound channel as soon
as playback is completed; the callback function associated with a sound frame is an
appropriate way to send the
Close message to the channel.
Note
The system sound channel is never automatically disposed of even
if the sound channel frame is garbage collected. You must send
the
Close message to the channel to dispose of the system
sound channel.
Playing Sound Programmatically 14
You can use any of the global functions to play sound programmatically. For
example, you might want to play a sound when the user taps a button, or when
a lengthy operation is complete. Sounds can be played synchronously or
asynchronously, as described in the following section.
Page view 559
1 2 ... 555 556 557 558 559 560 561 562 563 564 565 ... 941 942

Comments to this Manuals

No comments