engine audio fixes
This commit is contained in:
parent
8c014802c9
commit
9d17655836
|
@ -11,10 +11,9 @@ void TAAudioSDL::onProcess(unsigned char* buf, int nframes) {
|
||||||
audioProcCallback(inBufs,outBufs,desc.inChans,desc.outChans,desc.bufsize);
|
audioProcCallback(inBufs,outBufs,desc.inChans,desc.outChans,desc.bufsize);
|
||||||
}
|
}
|
||||||
float* fbuf=(float*)buf;
|
float* fbuf=(float*)buf;
|
||||||
|
for (size_t j=0; j<desc.bufsize; j++) {
|
||||||
for (size_t i=0; i<desc.outChans; i++) {
|
for (size_t i=0; i<desc.outChans; i++) {
|
||||||
int k=0;
|
fbuf[j*desc.outChans+i]=outBufs[i][j];
|
||||||
for (size_t j=i; j<desc.bufsize*desc.outChans; j+=desc.outChans) {
|
|
||||||
fbuf[j]=outBufs[i][k++];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,11 @@
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
void process(float** in, float** out, int inChans, int outChans, unsigned int size) {
|
void process(float** in, float** out, int inChans, int outChans, unsigned int size) {
|
||||||
for (int i=0; i<outChans; i++) {
|
static int count;
|
||||||
for (unsigned int j=0; j<size; j++) {
|
for (unsigned int i=0; i<size; i++) {
|
||||||
out[i][j]=(float)(j%128)/128.0f;
|
count++;
|
||||||
|
for (int j=0; j<outChans; j++) {
|
||||||
|
out[j][i]=((count%160)>40)?0.5:0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -608,6 +610,7 @@ void DivEngine::play() {
|
||||||
bool DivEngine::init() {
|
bool DivEngine::init() {
|
||||||
output=new TAAudioSDL;
|
output=new TAAudioSDL;
|
||||||
want.bufsize=1024;
|
want.bufsize=1024;
|
||||||
|
want.rate=44100;
|
||||||
want.fragments=2;
|
want.fragments=2;
|
||||||
want.inChans=0;
|
want.inChans=0;
|
||||||
want.outChans=2;
|
want.outChans=2;
|
||||||
|
|
Loading…
Reference in a new issue