Skip to content

Commit 0ad86a9

Browse files
mXalnjsarabia
authored andcommitted
Fixed the bug when on audio insert verses markers didn't change their… (#1161)
* Fixed the bug when on audio insert verses markers didn't change their location * App version increased
1 parent b8e0062 commit 0ad86a9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • translationRecorder/app/src/main/java/org/wycliffeassociates/translationrecorder/wav

translationRecorder/app/src/main/java/org/wycliffeassociates/translationrecorder/wav/WavFile.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,20 @@ public static WavFile compileChapter(Project project, int chapter, List<WavFile>
578578
}
579579

580580
public static WavFile insertWavFile(WavFile base, WavFile insert, int insertFrame) throws IOException, JSONException {
581+
582+
// Prepare new metadata
583+
WavMetadata newMetadata = base.getMetadata();
584+
for (WavCue cue: newMetadata.getCuePoints()) {
585+
if(cue.getLocation() >= insertFrame) {
586+
cue.setLocation(cue.getLocation() + (insert.getTotalAudioLength()/2));
587+
}
588+
}
589+
581590
//convert to two byte PCM
582591
insertFrame *= 2;
592+
583593
File result = new File(base.getFile().getParentFile(),"temp.wav");
584-
WavFile resultWav = new WavFile(result, base.getMetadata());
594+
WavFile resultWav = new WavFile(result, newMetadata);
585595

586596
long start = System.currentTimeMillis();
587597

0 commit comments

Comments
 (0)