gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.54k stars 2.45k forks source link

Hide the waveform when playing recorded audio if `show_recording_waveform` is `False` #6801

Open abidlabs opened 9 months ago

abidlabs commented 9 months ago

Currently, if you set show_recording_waveform to False in WaveformOptions and pass it to waveform_options in gr.Audio(), it hides the waveform when recording audio, but still shows the waveform when playing the recorded audio. I think the expectation from users would to hide it when playing recorded audio as well.

Reproduction

input_audio = gr.Audio(
    sources=["microphone"],
    waveform_options=gr.WaveformOptions(
        show_recording_waveform=False
    ),
)
demo = gr.Interface(
    fn=lambda x:x,
    inputs=input_audio,
    outputs="audio",
)

demo.launch()

cc @hannahblair

hannahblair commented 9 months ago

Thanks for catching this!

hannahblair commented 9 months ago

Just thinking about the best approach to this.

What do you think should be the UI when showing a recorded waveform? We can easily show the native audio player to play the audio - but what do we think should happen to the trimming functionality?

Our options are:

Both will require a bit of redesigning. My initial thoughts are that we only show the waveform if the user is currently trimming the audio.

abidlabs commented 9 months ago

The previous trimming UI wasn't very good. I think bringing back the waveform view when trimming is preferable. The main concern that the user had for disabling the waveform was the performance implications of rendering the waveform. So if the waveform is not shown by default, the performance concerns should be addressed?

hboen commented 8 months ago

i see that this issue is still not solved in the latest gradio-4.17.0. The waveformoption - False still not work.. Or there is another option to disable it?

dwipper commented 6 months ago

@abidlabs I'm on 4.21.0. The wave form stills shows when playing back a pre-recorded file. Is this the expected behavior?

TtS_audio = gr.Audio(label="Audio", sources='upload', interactive=False, type='filepath', visible=True, format='mp3', autoplay=True, show_download_button=False, waveform_options=gr.WaveformOptions(show_recording_waveform=False))

abidlabs commented 6 months ago

Yes currently that is the behavior @dwipper but this issue is exactly what you've pointed out, which is that we should also have an option (maybe the same option) to let developers disable the waveform for playback

hboen commented 5 months ago

it seems that this issue has NO high prio. I am at gradio 4.29 and it is still NOT solved. Why is this so difficult??? Make it default NO waveform (like in the early release)

hannahblair commented 5 months ago

Hi @hboen! There are a few things which have been pushed up on the priorities at the moment so this has fallen under the radar. I can see how this might be frustrating though so I'll get this sorted as soon as possible!

abidlabs commented 5 months ago

it seems that this issue has NO high prio. I am at gradio 4.29 and it is still NOT solved. Why is this so difficult??? Make it default NO waveform (like in the early release)

Hi @hboen, we understand your frustration, but please remember that this is an open-source repository maintained by a small team of contributors. Our team is working very hard in improving things but we do have competing priorities. If you have additional context for an issue or have a PR we can review, those are welcome but these kinds of "bumps" do not help. Feedback is always appreciated, but please don't forget there are people at the other side of the screen please 🤗

joshuacoffmanwwt commented 3 weeks ago

Any status update on this? The waveforms are causing a memory leak. Every time the mic or audio player creates one the memory continues to bubble up and it would be nice if we could turn it off entirely.

image