Fix remaining issue with sound. Now it will look for the first audio file in the directory as long as its .wav. Add more logging to catch issues.

This commit is contained in:
mmcwilliams 2024-04-25 12:03:35 -06:00
parent c5aecd3053
commit 07ba08d962
2 changed files with 17 additions and 9 deletions

4
.gitignore vendored
View File

@ -8,4 +8,6 @@ filmless_processing/data/frames/*.tif
filmless_processing/data/frames/*.PNG
filmless_processing/data/frames/*.JPEG
filmless_processing/data/frames/*.JPG
filmless_processing/data/frames/*.TIF
filmless_processing/data/frames/*.TIF
filmless_processing/data/audio/*.wav
filmless_processing/data/audio/*.WAV

View File

@ -163,7 +163,7 @@ String[] listFrames (String dir, String audioDir) {
audioDir = audioDir + SEP;
}
file = new File(dir);
audioFile = new File(SOUND);
audioFile = new File(audioDir);
if (file.isDirectory()) {
String names[] = file.list();
names = sort(names);
@ -184,15 +184,21 @@ String[] listFrames (String dir, String audioDir) {
return null;
}
String audioNames[] = audioFile.list();
if (audioNames != null) {
audioNames = sort(audioNames);
for (int i = 0; i < audioNames.length; i++) {
if (audioNames[i].toLowerCase().contains(".wav")) {
audioTmp.add(audioDir + audioNames[i]);
if (audioFile.isDirectory()) {
String audioNames[] = audioFile.list();
if (audioNames != null) {
audioNames = sort(audioNames);
for (int i = 0; i < audioNames.length; i++) {
if (audioNames[i].toLowerCase().contains(".wav")) {
audioTmp.add(audioDir + audioNames[i]);
}
}
} else {
println("Audio directory " + audioDir + " not found");
}
} else {
println("SOUND string " + audioDir + " does not point to a directory");
}
if (audioTmp.size() > 0) {