Update app.py
Browse files
app.py
CHANGED
@@ -142,15 +142,15 @@ def main():
|
|
142 |
st.markdown(wav)
|
143 |
#wav= wav.unsqueeze(0)
|
144 |
|
145 |
-
#2nd way
|
146 |
-
# Convert the tensor to a byte-like object in WAV format
|
147 |
-
with io.BytesIO() as buffer:
|
148 |
-
# Save the audio to the buffer using torchaudio
|
149 |
-
|
150 |
-
# Get the byte data from the buffer
|
151 |
-
|
152 |
-
# Play the audio file (WAV format)
|
153 |
-
st.audio(wav, format="audio/wav")
|
154 |
|
155 |
# wav, sample_rate = torchaudio.load(audio_file, format="mp3/wav")
|
156 |
st.markdown("SR")
|
|
|
142 |
st.markdown(wav)
|
143 |
#wav= wav.unsqueeze(0)
|
144 |
|
145 |
+
# #2nd way
|
146 |
+
# # Convert the tensor to a byte-like object in WAV format
|
147 |
+
# with io.BytesIO() as buffer:
|
148 |
+
# # Save the audio to the buffer using torchaudio
|
149 |
+
# torchaudio.save(buffer, wav, default_sr, format="wav")
|
150 |
+
# # Get the byte data from the buffer
|
151 |
+
# wav = buffer.getvalue()
|
152 |
+
# # Play the audio file (WAV format)
|
153 |
+
# st.audio(wav, format="audio/wav")
|
154 |
|
155 |
# wav, sample_rate = torchaudio.load(audio_file, format="mp3/wav")
|
156 |
st.markdown("SR")
|