Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -105,12 +105,9 @@ async def preview_handler(event):
|
|
105 |
async def send_handler(event):
|
106 |
user_id = event.sender_id
|
107 |
if user_id in states and states[user_id]:
|
108 |
-
|
109 |
-
# output_file_name = f"{user_id}_modified_audio"
|
110 |
-
# output_file = await Fusion.saveSound(states[user_id]["audio"], output_file_name)
|
111 |
-
# await event.reply(file=output_file)
|
112 |
|
113 |
-
await client.send_file(event.chat_id, file=
|
114 |
|
115 |
# Clean up - remove the user's state and the saved audio file
|
116 |
del states[user_id]
|
|
|
105 |
async def send_handler(event):
|
106 |
user_id = event.sender_id
|
107 |
if user_id in states and states[user_id]:
|
108 |
+
audio_bytes = states[user_id]['audio']
|
|
|
|
|
|
|
109 |
|
110 |
+
await client.send_file(event.chat_id, file=audio_bytes, attributes=[types.DocumentAttributeFilename(file_name="Audio.mp3"), types.DocumentAttributeAudio(duration=get_duration(audio_bytes))])
|
111 |
|
112 |
# Clean up - remove the user's state and the saved audio file
|
113 |
del states[user_id]
|