|
@@ -432,12 +432,7 @@ public class MergeTrackManager {
|
|
|
if (isLast) {
|
|
|
System.arraycopy(source, startIndex * destination.length, destination, 0, remainByteLength);
|
|
|
} else {
|
|
|
- if (startIndex == 0) {
|
|
|
- //去掉头部44个字节
|
|
|
- System.arraycopy(source, WAV_HEADER_LENGTH, destination, 0, destination.length - WAV_HEADER_LENGTH);
|
|
|
- } else {
|
|
|
- System.arraycopy(source, startIndex * destination.length, destination, 0, destination.length);
|
|
|
- }
|
|
|
+ System.arraycopy(source, startIndex * destination.length, destination, 0, destination.length);
|
|
|
}
|
|
|
if (isLast) {
|
|
|
return -1;
|
|
@@ -572,6 +567,7 @@ public class MergeTrackManager {
|
|
|
if (!isStereoWavFile) {
|
|
|
audiodata = AudioConverter.convertMonoToStereo(audiodata);
|
|
|
}
|
|
|
+ audiodata = removeWavHeader(audiodata);
|
|
|
byteArrayOutputStream.close();
|
|
|
return audiodata;
|
|
|
} catch (Exception e) {
|
|
@@ -580,6 +576,12 @@ public class MergeTrackManager {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private byte[] removeWavHeader(byte[] audiodata) {
|
|
|
+ byte[] results = new byte[audiodata.length - WAV_HEADER_LENGTH];
|
|
|
+ System.arraycopy(audiodata, WAV_HEADER_LENGTH, results, 0, results.length);
|
|
|
+ return results;
|
|
|
+ }
|
|
|
+
|
|
|
public void stop() {
|
|
|
ISPLAYSOUND = false;
|
|
|
if (mAudioTrack != null) {
|