Refactor directory comment, update file opening command, and improve German MP3 creation comment in generate_mp3.sh:

- Refactored a directory comment in the script for clarity.
- Updated the file opening command to use the correct path (/sdcard/handout.html).
- Improved the comment explaining the creation of German MP3 files.
This commit is contained in:
Ratatoskr 2024-02-06 17:38:20 +01:00
parent 45955451d7
commit 0fb0ae1e48
Signed by: Ratatoskr
GPG Key ID: 28B77439A6D78F4E

View File

@ -19,12 +19,11 @@ category_order=("date" "time")
# Directories # Directories
txt_dir="/data/scripts/.text" txt_dir="/data/scripts/.text"
mp3_dir="/data/scripts/.mp3" mp3_dir="/data/scripts/.mp3"
# remove old files # remove old files
rm -f "$txt_dir"/*complete.txt rm -f "$txt_dir"/*complete.txt
# open handout.md file # open handout.md file
am start --user 0 -a android.intent.action.VIEW -d file:///data/local/tmp/file.txt -t text/plain am start --user 0 -a android.intent.action.VIEW -d file:///sdcard/handout.html -t text
# Function to create MP3 files # Function to create MP3 files
create_mp3_files() { create_mp3_files() {
@ -34,7 +33,7 @@ create_mp3_files() {
base_filename=$(basename "$file" .txt) # File name without path and extension base_filename=$(basename "$file" .txt) # File name without path and extension
if [[ $file == *de.txt ]]; then if [[ $file == *de.txt ]]; then
# If it's a German file, create a German MP3 # If it's a German file, create a German MP3
/data/data/com.termux/files/usr/bin/gtts-cli -l de "$text" --output "$mp3_dir/$base_filename.mp3" /data/data/com.termux/files/usr/bin/gtts-cli -l de "$text" --output "$mp3_dir/$base_filename.mp3"
echo "$text" >> "$txt_dir/de_complete.txt" echo "$text" >> "$txt_dir/de_complete.txt"
echo "German MP3 file created: $base_filename.mp3" echo "German MP3 file created: $base_filename.mp3"