Spaces:
Running
Running
ageraustine
commited on
Commit
•
6f9fc8e
1
Parent(s):
01fc4a7
response jsonify
Browse files
app.py
CHANGED
@@ -76,8 +76,9 @@ if st.button("Generate Audio") and genre and energy_level and description and te
|
|
76 |
payload = {"inputs": {"prompt": prompt, "duration": duration, "track": audio_base64}}
|
77 |
st.text("Generating audio...")
|
78 |
response = requests.post(API_URL, headers=headers, json=payload)
|
79 |
-
|
80 |
-
|
|
|
81 |
st.audio(st_state.audio, format="audio/wav", sample_rate=sample_rate, start_time=0)
|
82 |
|
83 |
# Post-processing options
|
|
|
76 |
payload = {"inputs": {"prompt": prompt, "duration": duration, "track": audio_base64}}
|
77 |
st.text("Generating audio...")
|
78 |
response = requests.post(API_URL, headers=headers, json=payload)
|
79 |
+
response = response.json()[0]
|
80 |
+
st_state.audio = np.array(response['generated_audio'], dtype=np.float32)
|
81 |
+
sample_rate = response['sample_rate']
|
82 |
st.audio(st_state.audio, format="audio/wav", sample_rate=sample_rate, start_time=0)
|
83 |
|
84 |
# Post-processing options
|