fffiloni commited on
Commit
7aff1ca
β€’
1 Parent(s): c333336

Update share_btn.py

Browse files
Files changed (1) hide show
  1. share_btn.py +4 -4
share_btn.py CHANGED
@@ -39,8 +39,8 @@ share_js = """async () => {
39
  const res = await fetch(audioEL.src);
40
  const blob = await res.blob();
41
  const audioId = Date.now() % 200;
42
- const fileName = `img-to-sfx-${{audioId}}.mp4`;
43
- const musicBlob = new File([blob], fileName, { type: 'video/mp4' });
44
  console.log(musicBlob);
45
  return musicBlob;
46
  }
@@ -57,8 +57,8 @@ share_js = """async () => {
57
  const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
58
  const captionTxt = gradioEl.querySelector('#text-caption textarea').value;
59
  const inputImgEl = gradioEl.querySelector('#input-img img');
60
- const outputSound = gradioEl.querySelector('#sound-output video');
61
- const outputSound_src = gradioEl.querySelector('#sound-output video').src;
62
  const outputSound_name = outputSound_src.split('/').pop();
63
  const shareBtnEl = gradioEl.querySelector('#share-btn');
64
  const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
 
39
  const res = await fetch(audioEL.src);
40
  const blob = await res.blob();
41
  const audioId = Date.now() % 200;
42
+ const fileName = `img-to-sfx-${{audioId}}.wav`;
43
+ const musicBlob = new File([blob], fileName, { type: 'audio/wav' });
44
  console.log(musicBlob);
45
  return musicBlob;
46
  }
 
57
  const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
58
  const captionTxt = gradioEl.querySelector('#text-caption textarea').value;
59
  const inputImgEl = gradioEl.querySelector('#input-img img');
60
+ const outputSound = gradioEl.querySelector('#sound-output audio');
61
+ const outputSound_src = gradioEl.querySelector('#sound-output audio').src;
62
  const outputSound_name = outputSound_src.split('/').pop();
63
  const shareBtnEl = gradioEl.querySelector('#share-btn');
64
  const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');