Apple Newton Utilities User's Guide Page 558

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 557
CHAPTER 14
Sound
14-4 Using Sound
Using Sound 14
This section describes how to use sound to perform specic tasks. See Newton
Toolkit User’s Guide
for descriptions of the functions and methods discussed in
this section.
Creating and Using Custom Sound Frames 14
The following information applies to the Mac OS version of NTK. The Windows
version differs; see the
Newton Toolkit User’s Guide for details.
The compile-time functions
GetSound and GetSound11 allow you to use the
Newton Toolkit to create Newton sound frames from Mac OS
'snd ' resource
data. This section summarizes the main steps required to create custom sound
frames from Mac OS
'snd ' resources in NTK; for a complete discussion of this
material, see the
Newton Toolkit User’s Guide.
Follow these steps to add a custom sound to your application:
1. Include the sound resource le in your application’s NTK project.
2. In your application, create an evaluate slot to reference the sound frame through
a compile-time variable.
3. In your Project Data le
Open the sound resource le with OpenResFile or OpenResFileX.
If using OpenResFileX, store the le reference it returns.
Use the functions GetSound11 or GetSound to obtain the sound frame.
Use a compile-time variable to store the sound frame returned by GetSound
or
GetSound11.
Use the function CloseResFile or CloseResFileX, as appropriate, to
close the sound resource le. If you use the
CloseResFileX function, you
need to pass as its argument the saved le reference originally returned by
OpenResFileX.
4. In your application
Set the value of the evaluate slot to the name of the compile-time variable
that stores the sound frame.
Pass the name of the evaluate slot as the argument to the PlaySoundSync
function. These run-time functions play sound from anywhere in your code.
Page view 557
1 2 ... 553 554 555 556 557 558 559 560 561 562 563 ... 941 942

Comments to this Manuals

No comments