20 #include "../exception.h"
26 using namespace Audio;
34 template <
typename sample>
inline void fillSin(
42 unsigned char numChannels,
46 sample*
s = (sample*)buffer;
47 float f = 2 *
pi * frequency / sampleRate;
51 for (
unsigned char c = 0; c < numChannels; c++)
58 const dtime sampleRate,
60 const unsigned char numChannels,
61 const dtime maxBufferLen)
AudioSampleFormat sampleFormat
void render(TaskThread &thread, sample8 *buffer, const dtime bufferLength)
Renders audio data to the target output buffer given by the user.
void setClock(dtime time)
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
void prepare(const dtime sampleRate, const AudioSampleFormat sampleFormat, const unsigned char numChannels, const dtime maxBufferLen)
Prepares a source to render audio data.
unsigned char numChannels
virtual void setClock(dtime time)
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
static void insanity(const char *message)
#define BEATMUP_DEBUG_I(...)
AudioSampleFormat
Format of audio samples.
@ Int8
signed integer, 8 bit per sample
@ Int32
signed integer, 32 bit per sample
@ Float32
floating point, 32 bit per sample
@ Int16
signed integer, 16 bit per sample
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
void fillSin(sample8 *buffer, dtime time, dtime length, float volume, float frequency, float phase, dtime sampleRate, unsigned char numChannels, int scale)
JNIEnv jlong jint jint jint jint jfloat scale
JNIEnv jlong jfloat jfloat s
JNIEnv jlong jfloat jfloat jfloat v