Giter VIP home page Giter VIP logo

basic_pitch's Introduction

basic_pitch

Rust implementation of Spotify's Basic Pitch algorithm

This project is essentially a Rust port of the core from NeuralNote with a few tweaks to the source code. It is made primarily to work on mobile devices, but everyone should feel to make it work on their own devices. Pull requests are very welcome :-)

Dependencies

This project has Microsofts onnxruntime as a dependency, which is a very complex project to build. Therefore this crate uses build.rs to download pre-build binaries from this repository's release page. It will take some time and effort to really set this up properly. Right now only Android arm64-v8a works out of the box.

Building

Android

Right now only arm64-v8a is supported, for which you have to have the correct toolchain installed:

rustup target add aarch64-linux-android

In addition you also need the Android SDK and NDK to be installed. Using Android Studio is probably the easiest way to get these on your system.

This project is not linked to the C++ standard library by default, but it needs to be in the final product. In order to do that, create a build.rs for your project and add the following lines:

let ndk_dir = std::env::var("ANDROID_NDK_HOME").expect("set `ANDROID_NDK_HOME` env variable");

add_link_search_path(format!("{ndk_dir}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android"));
println!("cargo:rustc-link-lib=c++_shared");

Then to compile the project, you have to provide the NDK path and the path to the linker from the NDK (paths may be different on your machine):

# point to the ndk
export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk/25.2.9519653

# point to the linker from the ndk
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android33-clang++

# build your project
cargo build --target=aarch64-linux-android

Some of this may be different when your project is already using cargo-ndk for example.

basic_pitch's People

Contributors

w-ensink avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

basic_pitch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.