home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / sound / utilsound.h < prev   
Text File  |  1991-08-09  |  2KB  |  66 lines

  1.  
  2. /*
  3.  *    utilsound.h
  4.  *    Copyright 1988-89 NeXT, Inc.
  5.  *
  6.  */
  7.  
  8. #import "soundstruct.h"
  9. #import "sounderror.h"
  10.  
  11. int SNDSampleCount(SNDSoundStruct *s);
  12. /*
  13.  * Returns the number of sample frames in the sound. If the format is not
  14.  * recognized, or the sample count cannot be determined, then -1 is 
  15.  * returned.
  16.  */
  17.  
  18. int SNDGetDataPointer(SNDSoundStruct *s, char **ptr, int *size, int *width);
  19. /*
  20.  * Return a pointer to the data portion of a soundstruct in ptr, the
  21.  * number of samples (NOT sample frames) in size, and the number of bytes per
  22.  * sample in width. Fragmented sounds return an error.
  23.  * Returns an error code.
  24.  */
  25.  
  26. int SNDBytesToSamples(int byteCount, int channelCount, int dataFormat);
  27. int SNDSamplesToBytes(int sampleCount, int channelCount, int dataFormat);
  28. /*
  29.  * Converts bytes to samples and the converse, given also the channelCount
  30.  * and dataFormat. If the dataFormat is not recognized, then a negative value 
  31.  * is returned.
  32.  * The number returned from SNDSamplesToBytes is useful as the "dataSize" 
  33.  * argument to SNDAlloc.
  34.  */
  35.  
  36. int SNDAlloc(SNDSoundStruct **s,
  37.          int dataSize, 
  38.          int dataFormat,
  39.          int samplingRate,
  40.          int channelCount,
  41.          int infoSize);
  42. /*
  43.  * Allocate a souBSHtructure and initialize its fields. The actual sample
  44.  * data is uninitialized, and the info string buffer is extended to the 
  45.  * smallest quad boundary greater than zero. Both the dataSize and infoSize
  46.  * are expressed in bytes. An error code is returned.
  47.  * If no error, then a pointer to the allocated data is returned in "s".
  48.  */
  49.  
  50. int SNDFree(SNDSoundStruct *s);
  51. /*
  52.  * Frees "s", which was created and returned by one of the sound library
  53.  * routines.
  54.  */
  55.  
  56. int SNDPlaySoundfile(char *path, int priority);
  57. /*
  58.  * Play the soundfile specified by path. Playback occurs in the background,
  59.  * and this routine returns immediately. Playback interrupts any currently
  60.  * playing sound of the same or lower priority. When playback completes, 
  61.  * the storage allocated by this function is automatically deallocated.
  62.  * An error code is returned.
  63.  */
  64.  
  65.  
  66.