public unsafe static void ConverterFloatTo24LSBGeneric(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples) { float *ptr = (float *)((void *)inputInterleavedBuffer); byte *[] array = new byte *[nbChannels]; for (int i = 0; i < nbChannels; i++) { array[i] = (byte *)((void *)asioOutputBuffers[i]); } for (int j = 0; j < nbSamples; j++) { for (int k = 0; k < nbChannels; k++) { int num = ASIOSampleConvertor.clampTo24Bit((double)(*(ptr++))); byte *[] array2; IntPtr intPtr; byte * ptr2; (array2 = array)[(int)(intPtr = (IntPtr)k)] = (ptr2 = array2[(int)intPtr]) + 1; * ptr2 = (byte)num; byte *[] array3; IntPtr intPtr2; byte * ptr3; (array3 = array)[(int)(intPtr2 = (IntPtr)k)] = (ptr3 = array3[(int)intPtr2]) + 1; * ptr3 = (byte)(num >> 8); byte *[] array4; IntPtr intPtr3; byte * ptr4; (array4 = array)[(int)(intPtr3 = (IntPtr)k)] = (ptr4 = array4[(int)intPtr3]) + 1; *ptr4 = (byte)(num >> 16); } } }
public unsafe static void ConvertorFloatToShort2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples) { float *ptr = (float *)((void *)inputInterleavedBuffer); short *ptr2 = (short *)((void *)asioOutputBuffers[0]); short *ptr3 = (short *)((void *)asioOutputBuffers[1]); for (int i = 0; i < nbSamples; i++) { *(ptr2++) = ASIOSampleConvertor.clampToShort((double)(*ptr)); *(ptr3++) = ASIOSampleConvertor.clampToShort((double)ptr[1]); ptr += 2; } }
public unsafe static void ConvertorFloatToShortGeneric(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples) { float *ptr = (float *)((void *)inputInterleavedBuffer); short *[] array = new short *[nbChannels]; for (int i = 0; i < nbChannels; i++) { array[i] = (short *)((void *)asioOutputBuffers[i]); } for (int j = 0; j < nbSamples; j++) { for (int k = 0; k < nbChannels; k++) { short *[] array2; IntPtr intPtr; short * ptr2; (array2 = array)[(int)(intPtr = (IntPtr)k)] = (ptr2 = array2[(int)intPtr]) + 1; *ptr2 = ASIOSampleConvertor.clampToShort((double)(*(ptr++))); } } }