You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First: Why need addPCM8() an two dimensional array? Android outputs is one dimensional byte [1024]!
Second: My idea was to wait for next capture byte[] and then call addPCM8() and pass the last two.
Any idea to pass the multi array it to JNIEXPORT and finally call addPCM8()?
The text was updated successfully, but these errors were encountered:
Nobody out there? I get it work by convert to 16bit and pass it to addPCM() like in the example. Its moving to the beat.
It was more try and error, than exactly knowing what i did.
public void jniCalladdPCM(byte bytes[]){
short[] audioBuffer = new short[512];
short bufferSize = 512;
short multi = 2;
for(int i=0, j=0; i<audioBuffer.length; i++,j+=2){
audioBuffer[i] = ((short) ((bytes[j] -0x80 & 0xff) | (bytes[j+1] -0x80 << 8)));
}
libprojectMJNIWrapper.addPCM(audioBuffer, bufferSize);
}
I convert the out coming byte[1024] from onWaveFormDataCapture(Visualizer visualizer, byte[] bytes, int i) by putting two bytes together and removing the 8th bit of each of them.
I try to change audio capture instead with microphone with
Visualizer.OnDataCaptureListener
https://developer.android.com/reference/android/media/audiofx/Visualizer.OnDataCaptureListener
The output format is an 8-bit unsigned mono PCM
But how to pass it to
addPCM8( unsigned char PCMdata[2][1024])
?https://github.com/projectM-visualizer/projectm/blob/d789acbd3414a3c3b431455f0bc40f287928f4c4/src/libprojectM/PCM.cpp#L222
First: Why need addPCM8() an two dimensional array? Android outputs is one dimensional
byte [1024]
!Second: My idea was to wait for next capture byte[] and then call addPCM8() and pass the last two.
Any idea to pass the multi array it to JNIEXPORT and finally call addPCM8()?
The text was updated successfully, but these errors were encountered: