Commit b2a24dd5 authored by BERTHAUT Florent's avatar BERTHAUT Florent
Browse files

Added buffer size setting

parent addab6e9
......@@ -15,7 +15,9 @@ void Gdpd::_register_methods() {
register_method("set_volume", &Gdpd::set_volume);
}
int Gdpd::audioCallback(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData){
int Gdpd::audioCallback(void *outputBuffer, void *inputBuffer,
unsigned int nBufferFrames, double streamTime,
RtAudioStreamStatus status, void *userData){
Gdpd* gdpd = static_cast<Gdpd*>(userData);
gdpd->processAudio(outputBuffer, inputBuffer, nBufferFrames, streamTime,
status, userData);
......@@ -32,7 +34,7 @@ void Gdpd::_init() {
Gdpd::~Gdpd() {
}
int Gdpd::init(int nbInputs, int nbOutputs, int sampleRate) {
int Gdpd::init(int nbInputs, int nbOutputs, int sampleRate, int bufferSize) {
if(!m_pd.init(nbInputs, nbOutputs, sampleRate, true)) {
Godot::print("GDPD : Error starting libpd");
......@@ -62,7 +64,7 @@ int Gdpd::init(int nbInputs, int nbOutputs, int sampleRate) {
inParams.deviceId = m_audio.getDefaultOutputDevice();
outParams.nChannels = m_nbInputs = nbInputs;
inParams.nChannels = m_nbOutputs = nbOutputs;
m_bufferFrames = 128;
m_bufferFrames = bufferSize;
RtAudio::StreamOptions options;
options.streamName = "gdpd";
......
......@@ -38,7 +38,7 @@ public:
void _init();
//libpd functions
int init(int nbInputs, int nbOutputs, int sampleRate);
int init(int nbInputs, int nbOutputs, int sampleRate, int bufferSize);
void openfile(String basename, String dirname);
void closefile();
bool has_message();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment