In this commit, the 'generate_mp3.sh' script has been refined to improve language selection and category order:
- Modified the 'lang_order' array to prioritize German ('de') over Spanish ('es-l') as the default language.
- Updated comments for better script documentation.
These changes aim to enhance the script's configurability and clarity, making it easier to customize language preferences and maintain the script in the long run.
This commit includes changes to the 'generate_mp3.sh' script:
- Removed the commented-out command to open 'handout.md' file.
- Updated the command to open 'handout.html' file using 'am start'.
- Improved comments and formatting in the script.
The changes aim to enhance the script by removing unnecessary code and improving readability.
Note: Ensure that the 'am start' command works as expected with the updated file path.
- Add 'weather' to category_order array to include weather information in the generated MP3 files.
- Create directories /sdcard/.mp3/ and /sdcard/.text/ to store MP3 and text files respectively.
- Update txt_dir and mp3_dir paths to use /sdcard/ instead of /data/scripts/.
- Modify the 'am start' command to open handout.html in a Chromium tabbed activity for better compatibility.
- Remove unnecessary commented-out am start command and replace it with an updated command.
- Improve comments for better script understanding.
- 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.
The generate_mp3.sh script has been updated with the following changes:
- Added a comment to specify the directory for MP3 files.
- Implemented a command to open the handout.md file using the 'am start' command.
- The 'am start' command opens the file in VIEW mode with the 'text/plain' MIME type.
- This enhancement provides a convenient way to access the handout.md file directly.
The commit aims to improve the functionality and user experience of the generate_mp3.sh script by enabling easy access to the handout file.
In this commit, I made several improvements to the 'generate_mp3.sh' script:
1. Removed old complete files before processing to ensure a clean slate.
2. Modified the 'create_mp3_files' function to use '>>' instead of '>' when appending text to the complete files.
3. Updated the comments in the script for better clarity.
These changes help maintain a more organized and reliable MP3 generation process. The script now properly appends text to the 'de_complete.txt' and 'es_complete.txt' files, and it removes old complete files before starting the processing.
File Changes:
- Modified 'generate_mp3.sh' (see diff for details)
Note: Please review and test the changes to ensure they meet your requirements.
Added generate_mp3.sh script:
- Author: Michael Haider
- Created on: 26.01.2024
- Description: This script generates MP3 files from text files in German and Spanish using gtts-cli (Google Text-to-Speech).
- The script exports the path to the programs, defines language and category order, sets directories, and includes a function to create MP3 files.
- The generated MP3 files are created with gtts-cli in German or Spanish slow mode based on the file content.
- The script then sets the media volume and loops through categories and languages to play the generated MP3 files at normal or half speed, based on the language indication.