gaGetOutputBuffer(int)

Syntax

gaGetOutputBuffer(int)

Example

dim = BUFFER_SIZE*AUDIO_OUTPUT_CHANNELS
outputBuffer = memarray('float', dim)
stretch = OUTPUT_W/(dim-1)
zeroOffset = OUTPUT_H/4

function setup()
 // a simple sine oscillator
 gaWave(GA_SINE,220)
 
 // init the buffer
 for i = 0, dim - 1 do
 outputBuffer[i] = 0.0 
 end
 
end

function update()

 gaWaveVolume(0,(gaMouseY()/OUTPUT_H)/4)

 for i = 0, dim - 1 do
 outputBuffer[i] = gaGetOutputBuffer(i) 
 end
 
end

function draw()
 gaBackground(0.0,0.9)
 
 ofTranslate(0,OUTPUT_H/2,0)
 // draw Audio Scope
 ofSetColor(255)
 ofNoFill()
 ofBeginShape()
 for i = 0, dim - 1 do
 ofVertex(i* stretch, outputBuffer[i] * zeroOffset)
 end
 ofEndShape(false)
 
end

Description

This is a reference of the generated audio output stream from GAmuza. The audio files loaded with FMOD library, ex. every instance of ofSoundPlayer OpenFrameworks class, will not appear here in the output streaming buffer, because FMOD lib go another way.

Parameters

int

Returns

«Float, The audio output channel signal value at the specified index