Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,13 @@ def android_download():
|
|
| 56 |
|
| 57 |
def iphone_download():
|
| 58 |
try:
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 61 |
stdout, stderr = process.communicate()
|
| 62 |
|
|
|
|
| 56 |
|
| 57 |
def iphone_download():
|
| 58 |
try:
|
| 59 |
+
# Ensure Android ringtone exists first
|
| 60 |
+
android_ringtone_path = os.path.join(DOWNLOAD_FOLDER, 'AndroidRingtone.mp3')
|
| 61 |
+
if not os.path.exists(android_ringtone_path):
|
| 62 |
+
return "Error: Android ringtone not found. Please create the Android ringtone first."
|
| 63 |
+
|
| 64 |
+
# Convert Android ringtone to iPhone format
|
| 65 |
+
command = ['ffmpeg', '-i', android_ringtone_path, '-t', '20', '-acodec', 'aac', '-b:a', '128k', '-f', 'mp4', f'{DOWNLOAD_FOLDER}/iPhoneRingtone.m4r']
|
| 66 |
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 67 |
stdout, stderr = process.communicate()
|
| 68 |
|