Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
SampleSndPlay.cp
#include <Quickdraw.h> |
#include <Windows.h> |
#include <dialogs.h> |
#include <OSEvents.h> |
#include <Packages.h> |
#include <Sound.h> |
#define TRUE 0xFF |
#define FALSE 0 |
main() |
{ |
Point where = {20,20}; |
OSErr err; |
SFReply reply; |
short refnum; |
char* string; |
InitGraf(&qd.thePort); |
FlushEvents(everyEvent, 0); |
InitWindows(); |
InitDialogs(nil); |
InitCursor(); |
string = (char*) "\pPick a SND File"; |
SFGetFile (where, (Str255) string, nil, -1, (SFTypeList) nil, nil, &reply); |
err = FSOpen(reply.fName, reply.vRefNum, &refnum); |
if (err != noErr) |
Debugger(); |
err = SndStartFilePlay (nil, refnum, 0, 74000, nil, nil, nil, FALSE); |
if (err != noErr) |
Debugger(); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14