Sound-Streams are decoded while playing and as such are useful for large audio-files like music or speech.
More...
#include <kinc/global.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Sound-Streams are decoded while playing and as such are useful for large audio-files like music or speech.
◆ kinc_a1_sound_stream_channels()
| KINC_FUNC int kinc_a1_sound_stream_channels |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Gets the number of audio-channels the stream uses.
- Parameters
-
| stream | The stream to extract the number of channels from |
- Returns
- The number of audio-channels
◆ kinc_a1_sound_stream_create()
| KINC_FUNC kinc_a1_sound_stream_t * kinc_a1_sound_stream_create |
( |
const char * | filename, |
|
|
bool | looping ) |
Create a sound-stream from a wav file.
- Parameters
-
| filename | A path to a wav file |
| looping | Defines whether the stream will be looped automatically |
- Returns
- The newly created sound-stream
◆ kinc_a1_sound_stream_ended()
| KINC_FUNC bool kinc_a1_sound_stream_ended |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Returns whether the stream finished playing.
- Parameters
-
| stream | The stream to query |
- Returns
- Whether the stream finished playing
◆ kinc_a1_sound_stream_length()
| KINC_FUNC float kinc_a1_sound_stream_length |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Returns the length of the stream.
- Parameters
-
| stream | The stream to query |
- Returns
- The length of the stream in seconds
◆ kinc_a1_sound_stream_looping()
| KINC_FUNC bool kinc_a1_sound_stream_looping |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Returns whether the stream loops automatically.
- Parameters
-
| stream | The stream to extract the looping-information from |
- Returns
- Whether the stream loops
◆ kinc_a1_sound_stream_next_frame()
| KINC_FUNC float * kinc_a1_sound_stream_next_frame |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Gets the next audio-frame in the stream.
- Parameters
-
| stream | The stream to extract the frame from |
- Returns
- The next sample
◆ kinc_a1_sound_stream_position()
| KINC_FUNC float kinc_a1_sound_stream_position |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Returns the current playing-position of the stream.
- Parameters
-
| stream | The stream to query |
- Returns
- The current playing-position in seconds
◆ kinc_a1_sound_stream_reset()
| KINC_FUNC void kinc_a1_sound_stream_reset |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Resets the stream to its start-position.
- Parameters
-
| stream | The stream to change |
◆ kinc_a1_sound_stream_sample_rate()
| KINC_FUNC int kinc_a1_sound_stream_sample_rate |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Gets the sample-rate used by the stream.
- Parameters
-
| stream | The stream to extract the sample-rate from |
- Returns
- The sample-rate of the stream
◆ kinc_a1_sound_stream_set_looping()
| KINC_FUNC void kinc_a1_sound_stream_set_looping |
( |
kinc_a1_sound_stream_t * | stream, |
|
|
bool | loop ) |
Changes whether the stream is looped automatically.
- Parameters
-
| stream | The stream to change |
| loop | The new loop value to set |
◆ kinc_a1_sound_stream_set_volume()
| KINC_FUNC void kinc_a1_sound_stream_set_volume |
( |
kinc_a1_sound_stream_t * | stream, |
|
|
float | value ) |
Sets the stream's volume-multiplicator.
- Parameters
-
| stream | The stream to change |
| value | The volume-multiplicator |
◆ kinc_a1_sound_stream_volume()
| KINC_FUNC float kinc_a1_sound_stream_volume |
( |
kinc_a1_sound_stream_t * | stream | ) |
|
Gets the stream's volume-multiplicator.
- Parameters
-
| stream | The stream to query |
- Returns
- The volume-multiplicator