Snack_NewSound, Snack_DeleteSound, Snack_GetSound, Snack_ResizeSoundStorage,
Snack_UpdateExtremes - manipulate Snack sound objects


#include <snack.h>

Snack_NewSound(frequency, format, nChannels)
Snack_GetSound(interp, name)
Snack_ResizeSoundStorage(sound, length)
Snack_UpdateExtremes(sound, start, end, flag)


int frequency (in)
    Sampling frequency of the new sound object
int format (in)
    Sample encoding format of the new sound object
int nChannels (in)
    Number of channels of the new sound object
Sound *sound (in)
    Pointer to a Snack sound object
Tcl_Interp *interp (in)
char *name (in)
int length (in)
int start (in)
int end (in)
int flag (in)


Snack_NewSound creates a new Snack sound object by allocating and initializing a sound struct. It takes the arguments frequency, sample encoding format and number of channels, nChannels. Snack_DeleteSound deallocates all storage associated with sound. Snack_GetSound returns a pointer to a Snack sound given its sound command name.
Snack_ResizeSoundStorage is used to set the storage associated with a sound to accomodate length samples. Memory is allocated or deallocated as necessary. Snack_UpdateExtremes scans the samples of sound from start to end and records the extremes in the sound struct. The flag is used to specify whether to reset the current recorded extremes before calculating new ones (SNACK_NEW_SOUND) or if they should be kept and possibly updated (SNACK_MORE_DATA).