Update app.py
Browse files
app.py
CHANGED
@@ -58,6 +58,10 @@ def main():
|
|
58 |
with open(tmp_input_audio_file, "wb") as f:
|
59 |
f.write(audio_file.getbuffer())
|
60 |
|
|
|
|
|
|
|
|
|
61 |
# 展示文件到页面上
|
62 |
# st.audio(tmp_input_audio_file, format="audio/wav")
|
63 |
|
@@ -69,7 +73,7 @@ def main():
|
|
69 |
if add_watermark_button: # 点击按钮后执行的
|
70 |
if audio_file and watermark_text:
|
71 |
with st.spinner("Adding Watermark..."):
|
72 |
-
watermark = model.get_watermark(
|
73 |
# watermarked_audio, encode_time_cost = add_watermark(tmp_input_audio_file, watermark_text)
|
74 |
# st.write("Watermarked Audio:")
|
75 |
# print("watermarked_audio:", watermarked_audio)
|
|
|
58 |
with open(tmp_input_audio_file, "wb") as f:
|
59 |
f.write(audio_file.getbuffer())
|
60 |
|
61 |
+
wav, sample_rate = torchaudio.load(tmp_input_audio_file)
|
62 |
+
|
63 |
+
st.markdown("SR")
|
64 |
+
st.markdown(sample_rate)
|
65 |
# 展示文件到页面上
|
66 |
# st.audio(tmp_input_audio_file, format="audio/wav")
|
67 |
|
|
|
73 |
if add_watermark_button: # 点击按钮后执行的
|
74 |
if audio_file and watermark_text:
|
75 |
with st.spinner("Adding Watermark..."):
|
76 |
+
watermark = model.get_watermark(wav, default_sr)
|
77 |
# watermarked_audio, encode_time_cost = add_watermark(tmp_input_audio_file, watermark_text)
|
78 |
# st.write("Watermarked Audio:")
|
79 |
# print("watermarked_audio:", watermarked_audio)
|