Kore 3
Loading...
Searching...
No Matches
soundstream.h File Reference

Sound-Streams are decoded while playing and as such are useful for large audio-files like music or speech. More...

#include <kore3/global.h>
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  kore_mixer_sound_stream

Typedefs

typedef struct kore_mixer_sound_stream kore_mixer_sound_stream

Functions

KORE_FUNC kore_mixer_sound_stream * kore_mixer_sound_stream_create (const char *filename, bool looping)
 Create a sound-stream from a wav file.
KORE_FUNC float * kore_mixer_sound_stream_next_frame (kore_mixer_sound_stream *stream)
 Gets the next audio-frame in the stream.
KORE_FUNC int kore_mixer_sound_stream_channels (kore_mixer_sound_stream *stream)
 Gets the number of audio-channels the stream uses.
KORE_FUNC int kore_mixer_sound_stream_sample_rate (kore_mixer_sound_stream *stream)
 Gets the sample-rate used by the stream.
KORE_FUNC bool kore_mixer_sound_stream_looping (kore_mixer_sound_stream *stream)
 Returns whether the stream loops automatically.
KORE_FUNC void kore_mixer_sound_stream_set_looping (kore_mixer_sound_stream *stream, bool loop)
 Changes whether the stream is looped automatically.
KORE_FUNC bool kore_mixer_sound_stream_ended (kore_mixer_sound_stream *stream)
 Returns whether the stream finished playing.
KORE_FUNC float kore_mixer_sound_stream_length (kore_mixer_sound_stream *stream)
 Returns the length of the stream.
KORE_FUNC float kore_mixer_sound_stream_position (kore_mixer_sound_stream *stream)
 Returns the current playing-position of the stream.
KORE_FUNC void kore_mixer_sound_stream_reset (kore_mixer_sound_stream *stream)
 Resets the stream to its start-position.
KORE_FUNC float kore_mixer_sound_stream_volume (kore_mixer_sound_stream *stream)
 Gets the stream's volume-multiplicator.
KORE_FUNC void kore_mixer_sound_stream_set_volume (kore_mixer_sound_stream *stream, float value)
 Sets the stream's volume-multiplicator.

Detailed Description

Sound-Streams are decoded while playing and as such are useful for large audio-files like music or speech.

Function Documentation

◆ kore_mixer_sound_stream_channels()

KORE_FUNC int kore_mixer_sound_stream_channels ( kore_mixer_sound_stream * stream)

Gets the number of audio-channels the stream uses.

Parameters
streamThe stream to extract the number of channels from
Returns
The number of audio-channels

◆ kore_mixer_sound_stream_create()

KORE_FUNC kore_mixer_sound_stream * kore_mixer_sound_stream_create ( const char * filename,
bool looping )

Create a sound-stream from a wav file.

Parameters
filenameA path to a wav file
loopingDefines whether the stream will be looped automatically
Returns
The newly created sound-stream

◆ kore_mixer_sound_stream_ended()

KORE_FUNC bool kore_mixer_sound_stream_ended ( kore_mixer_sound_stream * stream)

Returns whether the stream finished playing.

Parameters
streamThe stream to query
Returns
Whether the stream finished playing

◆ kore_mixer_sound_stream_length()

KORE_FUNC float kore_mixer_sound_stream_length ( kore_mixer_sound_stream * stream)

Returns the length of the stream.

Parameters
streamThe stream to query
Returns
The length of the stream in seconds

◆ kore_mixer_sound_stream_looping()

KORE_FUNC bool kore_mixer_sound_stream_looping ( kore_mixer_sound_stream * stream)

Returns whether the stream loops automatically.

Parameters
streamThe stream to extract the looping-information from
Returns
Whether the stream loops

◆ kore_mixer_sound_stream_next_frame()

KORE_FUNC float * kore_mixer_sound_stream_next_frame ( kore_mixer_sound_stream * stream)

Gets the next audio-frame in the stream.

Parameters
streamThe stream to extract the frame from
Returns
The next sample

◆ kore_mixer_sound_stream_position()

KORE_FUNC float kore_mixer_sound_stream_position ( kore_mixer_sound_stream * stream)

Returns the current playing-position of the stream.

Parameters
streamThe stream to query
Returns
The current playing-position in seconds

◆ kore_mixer_sound_stream_reset()

KORE_FUNC void kore_mixer_sound_stream_reset ( kore_mixer_sound_stream * stream)

Resets the stream to its start-position.

Parameters
streamThe stream to change

◆ kore_mixer_sound_stream_sample_rate()

KORE_FUNC int kore_mixer_sound_stream_sample_rate ( kore_mixer_sound_stream * stream)

Gets the sample-rate used by the stream.

Parameters
streamThe stream to extract the sample-rate from
Returns
The sample-rate of the stream

◆ kore_mixer_sound_stream_set_looping()

KORE_FUNC void kore_mixer_sound_stream_set_looping ( kore_mixer_sound_stream * stream,
bool loop )

Changes whether the stream is looped automatically.

Parameters
streamThe stream to change
loopThe new loop value to set

◆ kore_mixer_sound_stream_set_volume()

KORE_FUNC void kore_mixer_sound_stream_set_volume ( kore_mixer_sound_stream * stream,
float value )

Sets the stream's volume-multiplicator.

Parameters
streamThe stream to change
valueThe volume-multiplicator

◆ kore_mixer_sound_stream_volume()

KORE_FUNC float kore_mixer_sound_stream_volume ( kore_mixer_sound_stream * stream)

Gets the stream's volume-multiplicator.

Parameters
streamThe stream to query
Returns
The volume-multiplicator