I got a float buffer array ranging -1 .. 1 contening wav sample info let's say of 1 second lenght 44100.
for now ive created an "AudioOut" ptArray output of blocsize, . and i srub my big buffer array on process procedure.
that works if i connect ausio outs to the array i do hear the escpected audio. but feel it would be more clean, i would get more function if i used a ptAudio instead.
Howerver im currently stuck, don't really understand how to work with.
im tring to precompute/fill a BLOC_SMP_BUFFER of bloc size, then 'apply it to Audioout but that doesn't seem to work that way.
Code: Select all
if (PLAY)
{
BLOC_SMP_BUFFER = new float[BlocSize];
sdkSetEvtSize(Audio_Out, BlocSize); //set size temporary here for debug, will be in callback
sdkSetEvtSize(AudioOut, BlocSize); // Audio_Out is a ptArray, AudioOut ptAudiio
CurrentBloc = CurrentBloc + 1;
if (CurrentBloc > floor(( SMP_DURATION / BlocSize ))) // loops if reaching end of buffer
{
CurrentBloc = 0;
}
for (int i = 0; i < BlocSize; i++)
{
BLOC_SMP_BUFFER[i] = SMP_BUFFER[i + (CurrentBloc * BlocSize)]; //preparing a blocsize filled buffer
//sdkSetEvtArrayData(Audio_Out, i, SMP_BUFFER[i + (CurrentBloc * BlocSize)]); // old code that was working if ptArrayOut
//sdkSetEvtPointer(AudioOut, BLOC_SMP_BUFFER);
}
sdkSetEvtPointer(AudioOut, BLOC_SMP_BUFFER); // trying to set the ptaudio out, doesn't seem to work, what's the correct way of doing?
}