Skip to content

Commit

Permalink
Upload audio ios (#4071)
Browse files Browse the repository at this point in the history
* changes

* changes

* change

* changes

* changes

* changes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
  • Loading branch information
aliabid94 and abidlabs authored May 9, 2023
1 parent c7f4a88 commit 1910df1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

## Bug Fixes:

- Allow users to upload audio files in Audio component on iOS by by [@aliabid94](https://github.com/aliabid94) in [PR 4071](https://github.com/gradio-app/gradio/pull/4071).
- Fixes the gradio theme builder error that appeared on launch by [@aliabid94](https://github.com/aliabid94) and [@abidlabs](https://github.com/abidlabs) in [PR 4080](https://github.com/gradio-app/gradio/pull/4080)
- Keep Accordion content in DOM by [@aliabid94](https://github.com/aliabid94) in [PR 4070](https://github.com/gradio-app/gradio/pull/4073)
- Fixed bug where type hints in functions caused the event handler to crash by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4068](https://github.com/gradio-app/gradio/pull/4068)
- Fix dropdown default value not appearing by [@aliabid94](https://github.com/aliabid94) in [PR 4072](https://github.com/gradio-app/gradio/pull/4072).
- Soft theme label color fix by [@aliabid94](https://github.com/aliabid94) in [PR 4070](https://github.com/gradio-app/gradio/pull/4070)
Removes extraneous `State` component info from the `/info` route by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107)
- Removes extraneous `State` component info from the `/info` route by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107)

## Documentation Changes:

Expand Down
14 changes: 12 additions & 2 deletions js/audio/src/Audio.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@
function handle_load({
detail
}: {
detail: { data: string; name: string; size: number; is_example: boolean };
detail: {
data: string;
name: string;
size: number;
is_example: boolean;
};
}) {
value = detail;
dispatch("change", { data: detail.data, name: detail.name });
Expand Down Expand Up @@ -276,7 +281,12 @@
{/if}
</div>
{:else if source === "upload"}
<Upload filetype="audio/*" on:load={handle_load} bind:dragging>
<!-- explicitly listed out audio mimetypes due to iOS bug not recognizing audio/* -->
<Upload
filetype="audio/aac,audio/midi,audio/mpeg,audio/ogg,audio/wav,audio/x-wav,audio/opus,audio/webm,audio/flac,audio/vnd.rn-realaudio,audio/x-ms-wma,audio/x-aiff,audio/amr,audio/*"
on:load={handle_load}
bind:dragging
>
<slot />
</Upload>
{/if}
Expand Down

0 comments on commit 1910df1

Please sign in to comment.