mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-17 09:46:02 +00:00
chore: ToolAudioInput accepted types changed to supported conversion formats
This commit is contained in:
parent
46d4e1ce1f
commit
29852a44dd
@ -2,13 +2,19 @@ import React, { useRef } from 'react';
|
|||||||
import { Box, Typography } from '@mui/material';
|
import { Box, Typography } from '@mui/material';
|
||||||
import BaseFileInput from './BaseFileInput';
|
import BaseFileInput from './BaseFileInput';
|
||||||
import { BaseFileInputProps } from './file-input-utils';
|
import { BaseFileInputProps } from './file-input-utils';
|
||||||
|
import { AUDIO_FORMATS } from 'pages/tools/converters/audio-converter/types';
|
||||||
|
|
||||||
interface AudioFileInputProps extends Omit<BaseFileInputProps, 'accept'> {
|
interface AudioFileInputProps extends Omit<BaseFileInputProps, 'accept'> {
|
||||||
accept?: string[];
|
accept?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AUDIO_ACCEPT_TYPES = [
|
||||||
|
'audio/*',
|
||||||
|
...Object.keys(AUDIO_FORMATS).map((format) => `.${format}`)
|
||||||
|
];
|
||||||
|
|
||||||
export default function ToolAudioInput({
|
export default function ToolAudioInput({
|
||||||
accept = ['audio/*', '.mp3', '.wav', '.aac'],
|
accept = AUDIO_ACCEPT_TYPES,
|
||||||
...props
|
...props
|
||||||
}: AudioFileInputProps) {
|
}: AudioFileInputProps) {
|
||||||
const audioRef = useRef<HTMLAudioElement>(null);
|
const audioRef = useRef<HTMLAudioElement>(null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user