otioss commited on
Commit
bd6bb1a
·
1 Parent(s): 83f3fdc

change to direct audio

Browse files
Files changed (2) hide show
  1. accent_gradio.py +22 -21
  2. original_voice.wav +0 -3
accent_gradio.py CHANGED
@@ -205,7 +205,8 @@ def transcribe(audio):
205
  transcribed_text = "An error occured. Please try again."
206
 
207
  print(transcribed_text)
208
- ref_s = compute_style(original_voice_path)
 
209
  wav = inference(transcribed_text, ref_s, alpha=0.1, beta=0.5, diffusion_steps=10, embedding_scale=1)
210
  scaled = np.int16(wav / np.max(np.abs(wav)) * 32767)
211
  return (sample_rate_value, scaled)
@@ -222,27 +223,27 @@ with gr.Blocks() as demo:
222
  ### Transform your non-native accent into a native North American accent.
223
  **This is an educational app designed to transform the speech of a non-native English speaker into a native American accent.**
224
  **The tool aims to assist learners in accent reduction and pronunciation improvement.**
225
- **For newcomers, kindly navigate to the *First-Time Users* section by clicking on the designated link.**
226
  """)
227
- with gr.Accordion("First-Time Users (Click Here):", open=False):
228
- gr.Markdown("""
229
- **Record the reference voice:** Kindly capture your voice as you read the provided
230
- text. Please ensure that you have granted microphone access in your browser settings.
231
-
232
- > I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration.
233
- I will face my fear. I will permit it to pass over me and through me. And when it has gone past I
234
- will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.
235
-
236
- Ensure clarity in your pronunciation, as the quality of this recording
237
- significantly influences the future results. Once done please click "Save".
238
- If the quality of the native voice is not satisfactory, you can come back and
239
- re-record your voice here again.
240
-
241
- You can also upload your voice or someone else's voice.
242
- """)
243
- speaker_voice = gr.Audio(sources=["microphone", "upload"], format="wav", label="Record reference voice:",show_download_button="True")
244
- ref_btn = gr.Button("Save")
245
- ref_btn.click(record_speaker, inputs= speaker_voice, outputs=None)
246
 
247
 
248
  with gr.Column():
 
205
  transcribed_text = "An error occured. Please try again."
206
 
207
  print(transcribed_text)
208
+ # ref_s = compute_style(original_voice_path) # run locally
209
+ ref_s = compute_style(audio) # run on HF
210
  wav = inference(transcribed_text, ref_s, alpha=0.1, beta=0.5, diffusion_steps=10, embedding_scale=1)
211
  scaled = np.int16(wav / np.max(np.abs(wav)) * 32767)
212
  return (sample_rate_value, scaled)
 
223
  ### Transform your non-native accent into a native North American accent.
224
  **This is an educational app designed to transform the speech of a non-native English speaker into a native American accent.**
225
  **The tool aims to assist learners in accent reduction and pronunciation improvement.**
226
+ **This tool performs better on longer speech.**
227
  """)
228
+ # with gr.Accordion("First-Time Users (Click Here):", open=False):
229
+ # gr.Markdown("""
230
+ # **Record the reference voice:** Kindly capture your voice as you read the provided
231
+ # text. Please ensure that you have granted microphone access in your browser settings.
232
+
233
+ # > I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration.
234
+ # I will face my fear. I will permit it to pass over me and through me. And when it has gone past I
235
+ # will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.
236
+
237
+ # Ensure clarity in your pronunciation, as the quality of this recording
238
+ # significantly influences the future results. Once done please click "Save".
239
+ # If the quality of the native voice is not satisfactory, you can come back and
240
+ # re-record your voice here again.
241
+
242
+ # You can also upload your voice or someone else's voice.
243
+ # """)
244
+ # speaker_voice = gr.Audio(sources=["microphone", "upload"], format="wav", label="Record reference voice:",show_download_button="True")
245
+ # ref_btn = gr.Button("Save")
246
+ # ref_btn.click(record_speaker, inputs= speaker_voice, outputs=None)
247
 
248
 
249
  with gr.Column():
original_voice.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ca4a4ef995535c9b58b46c4ba5a9512772a060a6e1ca5bdb1a23eba6fbf695e2
3
- size 2304044