NNS_SndArcStrmStart

Syntax

#include <nnsys/snd.h>
BOOL NNS_SndArcStrmStart(
        NNSSndStrmHandle* handle,
        int strmNo,
        u32 offset );

Arguments

handle Pointer to the stream handle.
strmNo This is the stream number.
offset This is the start offset position. The units are msec.

Return Values

If playback succeeds, returns TRUE. If it fails, returns FALSE.

Description

This function plays a stream. Use the NNS_SndArcStrmPrepareEx function or the NNS_SndArcStrmPrepareEx2 function to specify the player number.

The sound archive stream library must be initialized in advance using the NNS_SndArcStrmInit function.

The stream handle handle needs to be initialized only once in advance using the NNS_SndStrmHandleInit function. Calling this function releases the stream already attached to the stream handle (this does not mean it is stopped). If playback succeeds, the stream is attached to the stream handle.

If a non-zero value is set for the start offset position offset, it is possible to play from the middle of the stream data.

Prior to stream playback, the starting data needs to be loaded into the stream buffer so the beginning of the actual sound production is delayed a few frames. If you want to start playback immediately, the data load to the stream buffer needs to be completed in advance. The NNS_SndArcStrmPrepare function is used for this.

The channels used for stream playback are allocated in this function. If the allocated channels were being used by sequence playback, the sound being produced is forcibly stopped. To control the timing of channel allocation, the NNS_SndArcStrmAllocChannel function needs to be called in advance.

If the stream data is in stereo, channel 0 is output from the left and channel 1 from the right. These settings can be changed with the NNS_SndArcStrmSetChannelPan function.

Playback failure may be the result of the following factors:

  • The stream number is invalid.
  • The priority is lower than the stream already being played.
  • The channel to be used by the stream player is already in use.

See Also

NNS_SndArcStrmPrepareEx, NNS_SndArcStrmPrepareEx2, NNS_SndArcStrmInit, NNS_SndStrmHandleInit, NNS_SndArcStrmPrepare, NNS_SndArcStrmAllocChannel, NNS_SndArcStrmSetChannelPan

Revision History

2004/11/26 Isolated the explanation for the NNS_SndArcStrmStartEx function.
2004/10/05 Added the NNS_SndArcStrmStartEx function.
2004/08/10 Initial version.


CONFIDENTIAL