Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
botbahlul authored Mar 16, 2023
1 parent 157d59a commit 0a494a7
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 170 deletions.
8 changes: 7 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ android {
}
}

defaultConfig {
python {
staticProxy "autosrt"
}
}

minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.5.5"
versionName "1.5.6"

ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/com/android/autosrt/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1192,13 +1192,14 @@ private void transcribe() {
pyObjSubtitleFilePath = py.getModule("autosrt").callAttr(
"transcribe",
src_code, dst_code, filesPath.get(i), filesDisplayName.get(i), tmpWavFile[i].toString(), subtitleFormat, MainActivity.this, textview_output_messages);
String subtitleFilePath = pyObjSubtitleFilePath.toString();
subtitleFilesPath.add(subtitleFilePath);
String translatedSubtitleFilePath = StringUtils.substring(subtitleFilePath, 0, subtitleFilePath.length() - 4) + ".translated." + subtitleFormat;
translatedSubtitleFilesPath.add(translatedSubtitleFilePath);
saveSubtitleFileToDocumentsDir(filesDisplayName.get(i), subtitleFilePath);
if (pyObjSubtitleFilePath != null) {
String subtitleFilePath = pyObjSubtitleFilePath.toString();
subtitleFilesPath.add(subtitleFilePath);
String translatedSubtitleFilePath = StringUtils.substring(subtitleFilePath, 0, subtitleFilePath.length() - 4) + ".translated." + subtitleFormat;
translatedSubtitleFilesPath.add(translatedSubtitleFilePath);
saveSubtitleFileToDocumentsDir(filesDisplayName.get(i), subtitleFilePath);
}
}

}
runOnUiThread(() -> textview_currentFilePathProceed.setText(""));

Expand Down
Loading

0 comments on commit 0a494a7

Please sign in to comment.