home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20545 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  2.0 KB

  1. Path: sparky!uunet!oracle!unrepliable!bounce
  2. Newsgroups: comp.sys.mac.programmer
  3. From: tmorrow@oracle.com (Thomas Morrow)
  4. Subject: help- sound playing w/ bufferCmd
  5. Message-ID: <TMORROW.93Jan2151912@af4hp.oracle.com>
  6. Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
  7. Nntp-Posting-Host: af4hp.us.oracle.com
  8. Organization: Oracle Corporation, Belmont, CA
  9. Distribution: comp
  10. Date: Sat, 2 Jan 1993 23:19:12 GMT
  11. X-Disclaimer: This message was written by an unauthenticated user
  12.               at Oracle Corporation.  The opinions expressed are those
  13.               of the user and not necessarily those of Oracle.
  14. Lines: 40
  15.  
  16.  
  17. I am having trouble using SndDoCommand to play a sampled sound header.
  18.  
  19. I do:
  20.     SndCommand mySndCmd;
  21.     
  22.     /* mySndH is a handle to a sound header and data */
  23.     /* mySndChan is already properly opened */
  24.     mySndCmd.cmd;
  25.     mySndCmd.param1 = 0;
  26.     mySndCmd.param2 = (long)(*mySndH) & 0xffffff;
  27.     SndDoCommand(mySndChan, mySndCmd, false);
  28.  
  29. This does not work for some reason; I can't figure out why because if
  30. I replace the SndDoCommand with a Snd Play, it works:
  31.  
  32.     SndPlay(mySndChan, mySndH, true);
  33.     
  34. So the channel and header must be alright.  I am new to Mac
  35. programming, and wasn't sure exactly how to set param2 (a long) to the
  36. header address (Ptr)... The IM IV uses ORD4() to do the type
  37. conversion, but I am using Think C rather than Lisa Pascal. My way
  38. seems to work, but what is the elegant way?
  39.  
  40. Anyway, I use SndChannelStatus to get the status every event loop
  41. cycle, and the SCStatus returned is blank (zero) in all except CPUload
  42. (24),  ChannelAttributes (initMono), and ChannelBusy (true).  How can
  43. the channel be busy if StartTime == endTime == 0?
  44.  
  45.  
  46. Please email responses.  I will summarize.
  47.  
  48.             Tom             tmorrow@us.oracle.com
  49.  
  50. --
  51.  
  52. ---------------------------------------------------------------------------
  53. Tom Morrow       3OP4     voice:415-506-2202    Office: 427
  54. tmorrow@us.oracle.com       fax:415-506-7292    Application Object Library
  55. ---------------------------------------------------------------------------
  56.