The Game Kit Table of Contents | The Game Kit Index |
Derived from: BGameSound
Declared in: be/game/StreamingGameSound.h
Library: libgame.so
Allocation: Constructor only
The BStreamingGameSound class provides the ability to stream audio data. A hook function is called whenever a buffer needs to be filled with audio data. This hook function is set by calling SetStreamHook().
<<<more coming soon>>>
|
protected:
|
Prepares the object to play streamed audio. inBufferFrameCount specifies the number of frames each audio buffer should be able to hold. format indicates the audio format that will be streamed. inBufferCount specifies the number of buffers to use, and, as always, device is the sound device to use for playback.
By default, two audio buffers are used.
|
Stops playing the sound.
|
Fills the buffer specified by inBuffer with byteCount bytes of audio data.
In the BStreamingGameSound implemenation, this function calls the stream hook, if one exists.
See also: SetStreamHook()
|
Returns a status_t indicating whether or not the object was successfully instantiated.
RETURN CODES
B_OK. The sound was successfully initialized.
B_ERROR. Unable to create a sound player.
Other errors. The sound player may return errors.
See also: the BStreamingGameSound constructor
|
Lock() locks the BStreamingGameSound to prevent unpleasant collisions in the land of multithreadedness; it returns true if it was able to lock the object, otherwise false is returned. Unlock() releases the lock.
|
SetAttributes() is implemented to disallow the B_GS_LOOPING attribute, since streamed sounds can't loop.
See also: BGameSound::SetAttributes()
protected:
|
Changes the BStreamingGameSound object's parameters. This lets you change the buffer size, audio format, and number of buffers after the object has been instantiated.
RETURN CODES
B_OK. No error.
B_ERROR. Couldn't change the parameters.
|
Specfies the hook function to be called to fill buffers with audio data. cookie indicates the cookie pointer that will be passed to the hook function.
The inputs to the hook function are:
RETURN CODES
B_OK. The hook function was set without error.
The Game Kit Table of Contents | The Game Kit Index |
Copyright © 1999 Be, Inc. All rights reserved.
Text last modified