Back to project page android-wav-mixer.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2014 Nathan Sizemore <nathanrsizemore@gmail.com> Everyone is permitted to copy and distribute verbatim or modified ...
If you think the Android project android-wav-mixer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nathansizemore.beatmaker.audiomixer; //w w w .j a va 2 s . c o m import com.nathansizemore.beatmaker.audiomixer.extras.WavStream; public class AudioChannel { public int id; public int downBeat; public int measure; public int pitch; public int volume; public byte[][][] measureBreakdown; public void buildMeasures(byte[] buffer) { measureBreakdown = new byte[WavStream.SAMPLE_NUM_MEASURES][WavStream.BEATS_PER_MEASURE][WavStream.CHUNK_SIZE]; int bufferPos = 0; for (int measure = 0; measure < measureBreakdown.length; measure++) { for (int downBeat = 0; downBeat < measureBreakdown[measure].length; downBeat++) { for (int i = 0; i < measureBreakdown[measure][downBeat].length; i++) { if (bufferPos >= buffer.length) { measureBreakdown[measure][downBeat][i] = buffer[buffer.length - 1]; } else { measureBreakdown[measure][downBeat][i] = buffer[bufferPos]; } bufferPos++; } } } } }