Spaces:
Running
Running
UPDATE
Browse files
app.py
CHANGED
@@ -185,13 +185,13 @@ async def audio_handler(event):
|
|
185 |
if event.is_private: return await event.respond("`Please send an audio file...`")
|
186 |
|
187 |
|
188 |
-
@client.on(events.NewMessage(incoming=True))
|
189 |
async def audio_editor(event):
|
190 |
file_path = f"downloads/{event.sender.id}_audio.mp3"
|
191 |
if not os.path.exists(file_path): return
|
192 |
try:
|
193 |
# Load the audio file using your AudioFusion class
|
194 |
-
audio = Fusion.loadSound(file_path)
|
195 |
except Fusion.InvalidMusicFileError as e:
|
196 |
await event.reply(f'Error: {e}')
|
197 |
return os.remove(file_path)
|
@@ -236,7 +236,7 @@ async def audio_editor(event):
|
|
236 |
audio = Fusion.effect8D(audio, *map(int, parameters))
|
237 |
await event.reply("`Following effect added to your audio file...`")
|
238 |
|
239 |
-
elif event.raw_text.startswith('/
|
240 |
# Parse parameters and apply the effect
|
241 |
# Example usage: /effectReverb 0.8 1 0.5 0.3 0.8
|
242 |
parameters = event.raw_text.split()[1:]
|
|
|
185 |
if event.is_private: return await event.respond("`Please send an audio file...`")
|
186 |
|
187 |
|
188 |
+
@client.on(events.NewMessage(incoming=True, pattern="/(edit|trim|volume|reverse|reverb|speedup|slowdown|effect8d|save|delete)"))
|
189 |
async def audio_editor(event):
|
190 |
file_path = f"downloads/{event.sender.id}_audio.mp3"
|
191 |
if not os.path.exists(file_path): return
|
192 |
try:
|
193 |
# Load the audio file using your AudioFusion class
|
194 |
+
audio = Fusion.loadSound(os.path.abspath(file_path))
|
195 |
except Fusion.InvalidMusicFileError as e:
|
196 |
await event.reply(f'Error: {e}')
|
197 |
return os.remove(file_path)
|
|
|
236 |
audio = Fusion.effect8D(audio, *map(int, parameters))
|
237 |
await event.reply("`Following effect added to your audio file...`")
|
238 |
|
239 |
+
elif event.raw_text.startswith('/reverb'):
|
240 |
# Parse parameters and apply the effect
|
241 |
# Example usage: /effectReverb 0.8 1 0.5 0.3 0.8
|
242 |
parameters = event.raw_text.split()[1:]
|