25#ifndef _SKYLICHTAUDIO_ISTREAM_H_
26#define _SKYLICHTAUDIO_ISTREAM_H_
28#include "SkylichtAudioAPI.h"
75 virtual int read(
unsigned char* buff,
int len) = 0;
109 int m_referenceCount;
118 m_referenceCount = 1;
148 if (m_referenceCount <= 0)
181 m_sampleRate = sampleRate;
182 m_channels = channels;
Interface for a stream cursor, providing seek and read operations on an audio stream.
Definition IStream.h:39
virtual bool readyReadData(int len)=0
Check if a certain amount of data is ready to be read.
virtual bool endOfStream()=0
Check if the cursor is at the end of the stream.
EOrigin
Origin for seek operations.
Definition IStream.h:45
@ OriginCurrent
Seek from the current position.
Definition IStream.h:47
@ OriginEnd
Seek from the end of the stream.
Definition IStream.h:48
@ OriginStart
Seek from the beginning of the stream.
Definition IStream.h:46
virtual int seek(int pos, EOrigin origin)=0
Move the cursor position.
virtual int size()=0
Get total size of the stream.
virtual int tell()=0
Get current cursor position.
virtual void trim()
Trim read data from the stream (used in dynamic streams).
Definition IStream.h:99
virtual int read(unsigned char *buff, int len)=0
Read data from the stream.
virtual IStreamCursor * createCursor()=0
Create a new cursor for this stream.
int getChannels()
Get number of channels (for recorder/procedural streams).
Definition IStream.h:169
virtual void grab()
Increment reference count.
Definition IStream.h:136
virtual bool drop()
Decrement reference count and delete if zero.
Definition IStream.h:145
int getSampleRate()
Get expected sample rate (for recorder/procedural streams).
Definition IStream.h:160
virtual void uploadData(unsigned char *buffer, int size)
Upload new data to the stream (used in online/dynamic streams).
Definition IStream.h:190
void setStreamAudio(int sampleRate, int channels)
Set stream audio properties.
Definition IStream.h:179
virtual void stopStream()
Stop the stream and clear buffers.
Definition IStream.h:198
Handles all core audio functionality.
Definition AudioDebugLog.h:31
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29