Added supportApplication that converts ogg files to mp3 (Team send announcments via whatsapp) and some modifications to uC main
This commit is contained in:
parent
9ec98b52b6
commit
d6f7e16f16
2 changed files with 36 additions and 1 deletions
30
SupportProjects/AudioConverter/main.py
Normal file
30
SupportProjects/AudioConverter/main.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#/Users/jabrown/0/Audio
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def convert_folder(folder_path):
|
||||
for file in os.listdir(folder_path):
|
||||
if file.lower().endswith(".ogg"):
|
||||
input_path = os.path.join(folder_path, file)
|
||||
output_path = os.path.join(
|
||||
folder_path,
|
||||
os.path.splitext(file)[0] + ".mp3"
|
||||
)
|
||||
|
||||
print(f"Converting: {file} -> {os.path.basename(output_path)}")
|
||||
|
||||
subprocess.run([
|
||||
"ffmpeg",
|
||||
"-y", # overwrite if exists
|
||||
"-i", input_path,
|
||||
"-vn",
|
||||
"-acodec", "libmp3lame",
|
||||
"-ab", "192k",
|
||||
output_path
|
||||
], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
print("Done.")
|
||||
|
||||
# 👉 Set your folder here
|
||||
convert_folder(r"/Users/jabrown/0/Audio")
|
||||
|
|
@ -2,4 +2,9 @@ DFPlayer Structure
|
|||
Folder 1 = English
|
||||
|
||||
Folder 2 = Spanish
|
||||
1 =
|
||||
100 = Zona segura
|
||||
110 = Temp
|
||||
120 = Humidity
|
||||
130 = Pressure
|
||||
150 = AirQuality
|
||||
160 = Vibration
|
||||
Loading…
Reference in a new issue