Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ from wavmark.utils import file_reader
|
|
10 |
from audioseal import AudioSeal
|
11 |
import torchaudio
|
12 |
from pydub import AudioSegment
|
13 |
-
from notebook import play_audio, plot_waveform_and_specgram
|
14 |
|
15 |
# pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
16 |
|
@@ -153,12 +152,12 @@ def main():
|
|
153 |
#wav = my_read_file(wav,max_second_encode)
|
154 |
watermark = model.get_watermark(wav, default_sr)
|
155 |
watermarked_audio = wav + watermark
|
|
|
156 |
# watermarked_audio, encode_time_cost = add_watermark(tmp_input_audio_file, watermark_text)
|
157 |
st.write("Watermarked Audio:")
|
158 |
st.markdown(watermarked_audio)
|
159 |
print("watermarked_audio:", watermarked_audio)
|
160 |
-
|
161 |
-
play_audio(watermarked_audio)
|
162 |
#st.write("Time Cost: %d seconds" % encode_time_cost)
|
163 |
|
164 |
# # st.button("Add Watermark", disabled=False)
|
|
|
10 |
from audioseal import AudioSeal
|
11 |
import torchaudio
|
12 |
from pydub import AudioSegment
|
|
|
13 |
|
14 |
# pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
15 |
|
|
|
152 |
#wav = my_read_file(wav,max_second_encode)
|
153 |
watermark = model.get_watermark(wav, default_sr)
|
154 |
watermarked_audio = wav + watermark
|
155 |
+
watermarked_audio = soundfile.write("output.wav", watermarked_audio, default_sr)
|
156 |
# watermarked_audio, encode_time_cost = add_watermark(tmp_input_audio_file, watermark_text)
|
157 |
st.write("Watermarked Audio:")
|
158 |
st.markdown(watermarked_audio)
|
159 |
print("watermarked_audio:", watermarked_audio)
|
160 |
+
st.audio(watermarked_audio, format="audio/wav")
|
|
|
161 |
#st.write("Time Cost: %d seconds" % encode_time_cost)
|
162 |
|
163 |
# # st.button("Add Watermark", disabled=False)
|