How to use the spleeter.audio.adapter.get_audio_adapter function in spleeter

To help you get started, we’ve selected a few spleeter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deezer / spleeter / spleeter / commands / train.py View on Github external
def entrypoint(arguments, params):
    """ Command entrypoint.

    :param arguments: Command line parsed argument as argparse.Namespace.
    :param params: Deserialized JSON configuration file provided in CLI args.
    """
    audio_adapter = get_audio_adapter(arguments.audio_adapter)
    audio_path = arguments.audio_path
    estimator = _create_estimator(params)
    train_spec = _create_train_spec(params, audio_adapter, audio_path)
    evaluation_spec = _create_evaluation_spec(
        params,
        audio_adapter,
        audio_path)
    get_logger().info('Start model training')
    tf.estimator.train_and_evaluate(
        estimator,
        train_spec,
        evaluation_spec)
    get_logger().info('Model training done')
github deezer / spleeter / spleeter / commands / separate.py View on Github external
def entrypoint(arguments, params):
    """ Command entrypoint.

    :param arguments: Command line parsed argument as argparse.Namespace.
    :param params: Deserialized JSON configuration file provided in CLI args.
    """
    # TODO: check with output naming.
    audio_adapter = get_audio_adapter(arguments.audio_adapter)
    separator = Separator(arguments.configuration, arguments.MWF)
    for filename in arguments.inputs:
        separator.separate_to_file(
            filename,
            arguments.output_path,
            audio_adapter=audio_adapter,
            offset=arguments.offset,
            duration=arguments.duration,
            codec=arguments.codec,
            bitrate=arguments.bitrate,
            synchronous=False
        )
    separator.join()