mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-31 14:58:23 +00:00
🔊 restore input argument with warning
This commit is contained in:
@@ -19,7 +19,7 @@ from itertools import product
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Container, Dict, List
|
from typing import Container, Dict, List, Optional
|
||||||
|
|
||||||
from . import SpleeterError
|
from . import SpleeterError
|
||||||
from .options import *
|
from .options import *
|
||||||
@@ -89,7 +89,8 @@ def train(
|
|||||||
|
|
||||||
@spleeter.command()
|
@spleeter.command()
|
||||||
def separate(
|
def separate(
|
||||||
files: List[Path] = AudioInputOptions,
|
deprecated_file: Optional[str] = AudioInputOption,
|
||||||
|
files: List[Path] = AudioInputArgument,
|
||||||
adapter: str = AudioAdapterOption,
|
adapter: str = AudioAdapterOption,
|
||||||
bitrate: str = AudioBitrateOption,
|
bitrate: str = AudioBitrateOption,
|
||||||
codec: Codec = AudioCodecOption,
|
codec: Codec = AudioCodecOption,
|
||||||
@@ -108,6 +109,11 @@ def separate(
|
|||||||
from .separator import Separator
|
from .separator import Separator
|
||||||
|
|
||||||
configure_logger(verbose)
|
configure_logger(verbose)
|
||||||
|
if deprecated_file is not None:
|
||||||
|
logger.error(
|
||||||
|
'⚠️ -i option is not supported anymore, audio files must be supplied '
|
||||||
|
'using input argument instead (see spleeter separate --help)')
|
||||||
|
raise Exit(20)
|
||||||
audio_adapter: AudioAdapter = AudioAdapter.get(adapter)
|
audio_adapter: AudioAdapter = AudioAdapter.get(adapter)
|
||||||
separator: Separator = Separator(
|
separator: Separator = Separator(
|
||||||
params_filename,
|
params_filename,
|
||||||
|
|||||||
@@ -8,17 +8,15 @@ from os.path import join
|
|||||||
|
|
||||||
from .audio import Codec, STFTBackend
|
from .audio import Codec, STFTBackend
|
||||||
|
|
||||||
from typer import Option
|
from typer import Argument, Option
|
||||||
from typer.models import OptionInfo
|
from typer.models import ArgumentInfo, OptionInfo
|
||||||
|
|
||||||
__email__ = 'spleeter@deezer.com'
|
__email__ = 'spleeter@deezer.com'
|
||||||
__author__ = 'Deezer Research'
|
__author__ = 'Deezer Research'
|
||||||
__license__ = 'MIT License'
|
__license__ = 'MIT License'
|
||||||
|
|
||||||
AudioInputOptions: OptionInfo = Option(
|
AudioInputArgument: ArgumentInfo = Argument(
|
||||||
...,
|
...,
|
||||||
'--inputs',
|
|
||||||
'-i',
|
|
||||||
help='List of input audio file path',
|
help='List of input audio file path',
|
||||||
exists=True,
|
exists=True,
|
||||||
file_okay=True,
|
file_okay=True,
|
||||||
@@ -26,6 +24,12 @@ AudioInputOptions: OptionInfo = Option(
|
|||||||
readable=True,
|
readable=True,
|
||||||
resolve_path=True)
|
resolve_path=True)
|
||||||
|
|
||||||
|
AudioInputOption: OptionInfo = Option(
|
||||||
|
None,
|
||||||
|
'--inputs',
|
||||||
|
'-i',
|
||||||
|
help='(DEPRECATED) placeholder for deprecated input option')
|
||||||
|
|
||||||
AudioAdapterOption: OptionInfo = Option(
|
AudioAdapterOption: OptionInfo = Option(
|
||||||
'spleeter.audio.ffmpeg.FFMPEGProcessAudioAdapter',
|
'spleeter.audio.ffmpeg.FFMPEGProcessAudioAdapter',
|
||||||
'--adapter',
|
'--adapter',
|
||||||
|
|||||||
0
spleeter/py.typed
Normal file
0
spleeter/py.typed
Normal file
Reference in New Issue
Block a user