Spaces:
Running
Running
UPDATE
Browse files
app.py
CHANGED
@@ -139,6 +139,13 @@ with gr.Blocks(title="Audio Fusion") as iface:
|
|
139 |
client = TelegramClient('session_name', API_ID, API_HASH)
|
140 |
|
141 |
# Define the states for user interaction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
states = {}
|
143 |
|
144 |
@client.on(events.NewMessage(pattern='/start'))
|
@@ -198,9 +205,11 @@ async def audio_effect_handler(event):
|
|
198 |
else:
|
199 |
return await event.answer("INvalid for now...")
|
200 |
|
201 |
-
|
|
|
|
|
202 |
# Update the user's state with the modified sound
|
203 |
-
states[user_id]['audio'] =
|
204 |
|
205 |
await event.answer("Effect applied. Click /send to receive the modified audio file.", alert="True")
|
206 |
|
|
|
139 |
client = TelegramClient('session_name', API_ID, API_HASH)
|
140 |
|
141 |
# Define the states for user interaction
|
142 |
+
class State:
|
143 |
+
def __init__(self, client) -> None:
|
144 |
+
self.slow =
|
145 |
+
self.speed =
|
146 |
+
self.reverb =
|
147 |
+
self.reverse =
|
148 |
+
|
149 |
states = {}
|
150 |
|
151 |
@client.on(events.NewMessage(pattern='/start'))
|
|
|
205 |
else:
|
206 |
return await event.answer("INvalid for now...")
|
207 |
|
208 |
+
audio_file = BytesIO()
|
209 |
+
audio = modified_sound.export(audio_file, format="mp3")
|
210 |
+
audio.seek(0)
|
211 |
# Update the user's state with the modified sound
|
212 |
+
states[user_id]['audio'] = audio
|
213 |
|
214 |
await event.answer("Effect applied. Click /send to receive the modified audio file.", alert="True")
|
215 |
|