# ServiceSoundFile

Spools a sound file from disk to a sound buffer.

### Synopsis

`int32 ServiceSoundFile( SoundFilePlayer *sfp, int32 SignalIn, int32 *SignalNeeded )`

### Description

This function is called repeatedly to spool the sound file from disk to a sound buffer played by `StartSoundFile()` and controlled by the specified SoundFilePlayer data structure. It returns, in the SignalNeeded mask, the signal for the next sound buffer to finish playing. The task should use that signal in `WaitSignal()` to enter wait state where it can wait for the buffer to finish playing. When it exits wait state, it passes the signal mask returned to `ServiceSoundFile()` as the next buffer to write to.

### Arguments

sfp
  A pointer to the SoundFilePlayer data structure.

SignalIn
  A signal mask containing bits set corresponding to the cue bits of sound buffers to be filled.

SignalNeeded
  A pointer to a signal mask where the function writes the cue bit of the sound buffers for which the task should wait.

### Return Value

This function returns 0 if successful or an error code (a negative value) if an error occurs.

### Implementation

Library call implemented in music.lib V20.

### Associated Files

soundfile.h, music.lib

### See Also

``OpenSoundFile`(), CloseSoundFile(), DeleteSoundFilePlayer(), LoadSoundFile(), ReadSoundFile(), RewindSoundFile(), StartSoundFile(), StopSoundFile(), UnloadSoundFile(), CreateSoundFilePlayer()`