Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I compile cpp programs? #5

Closed
KangChou opened this issue Apr 12, 2022 · 1 comment
Closed

How do I compile cpp programs? #5

KangChou opened this issue Apr 12, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@KangChou
Copy link

KangChou commented Apr 12, 2022

How do I compile cpp programs?

https://github.com/jinay1991/spleeter

///
/// @file
/// @copyright Copyright (c) 2020, MIT License
///
#include "spleeter/argument_parser/cli_options.h"
#include "spleeter/spleeter.h"

#include <iostream>
#include <memory>

int main(void)
{
    try
    {
        /// Initialize
        auto cli_options = spleeter::CLIOptions{};
        cli_options.inputs = std::string{"external/audio_example/file/audio_example.wav"};
        cli_options.output_path = std::string{"separated_audio"};
        cli_options.configuration = std::string{"spleeter:5stems"};

        cli_options.audio_adapter = std::string{"audionamix"};
        cli_options.codec = std::string{"wav"};
        cli_options.bitrate = 192000;

        auto spleeter = std::make_unique<spleeter::Spleeter>(cli_options);
        spleeter->Init();

        /// Run
        spleeter->Execute();

        /// Deinitialize
        spleeter->Shutdown();
    }
    catch (std::exception& e)
    {
        std::cerr << "Caught Exception!! " << e.what() << std::endl;
        return 1;
    }

    return 0;
}
@jinay1991
Copy link
Owner

jinay1991 commented Apr 12, 2022

This is just a sample integration snapshot given as guide. I think what you are looking for is https://github.com/jinay1991/spleeter/blob/master/application/main.cpp which you can compile and run using following command:

$ bazel build //application:spleeter
$ bazel run //application:spleeter

More details can be found on README.md about dependencies and few other pre-requisites.
Hope this helps.

@jinay1991 jinay1991 self-assigned this Apr 12, 2022
@jinay1991 jinay1991 added the question Further information is requested label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants