gradio/js/audio/shared/VolumeLevels.svelte
Hannah f816136a03
Add volume control to Audio (#6254)
* fix autoplay and add trim_region_color setting

* add changeset

* add changeset

* add changeset

* remove unused param

* add changeset

* add volume control functionality

* add changeset

* corrent change event to stop_recording

* controls tweak

* add tests

* add changeset

* hide volume when blurred

* change bar height

* normalise -> normalize

* style tweaks

* clean up volume control

* add more tests

* formatting

* fix dispatch event

* amend refs to source

* add audio e2e

* add changeset

* fix test

* clean up ids + refs

* style tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-15 13:19:02 +01:00

13 lines
276 B
Svelte

<script lang="ts">
import { VolumeMuted, VolumeHigh, VolumeLow } from "@gradio/icons";
export let currentVolume: number;
</script>
{#if currentVolume == 0}
<VolumeMuted />
{:else if currentVolume < 0.5}
<VolumeLow />
{:else if currentVolume >= 0.5}
<VolumeHigh />
{/if}