Coder Social home page Coder Social logo

daniellga / harmonium Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 12.72 MB

Audio analysis and IO

Home Page: https://daniellga.github.io/harmonium/

License: MIT License

Rust 79.50% R 12.63% C 7.83% CSS 0.03%
audio-decoder fft audio-analysis audio-resampling

harmonium's People

Contributors

daniellga avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

sorhawell

harmonium's Issues

How to install r-harmonium?

Hi @daniellga

I was trying out your cool project and was building your project with rextendr::document() with dir r-hormonium as workdir.
However , I ran into a build error. It appears I have not installed library soxr on my antiquated macbook. See err msg below.
How should I install soxr or any other dependencies before?

have a great day :)

✔ Saving changes in the open files.
ℹ Generating extendr wrapper functions for package: harmonium.
ℹ Re-compiling harmonium (debug build)
── R CMD INSTALL ────────────────────────────────────────────────────────────────────────
─  installing *source* package ‘harmonium’ ...
   ** using staged installation
   ** libs
   using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
   using SDK: ‘’
   rm -Rf harmonium.so ./rust/target/release/libharmonium.a entrypoint.o
   clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include    -fPIC  -falign-functions=64 -Wall -g -O2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c entrypoint.c -o entrypoint.o
   # In some environments, ~/.cargo/bin might not be included in PATH, so we need
   # to set it here to ensure cargo can be invoked. It is appended to PATH and
   # therefore is only used if cargo is absent from the user's PATH.
   if [ "true" != "true" ]; then \
   		export CARGO_HOME=/Users/sorenwelling/Documents/projs/harmonium/r-harmonium/src/.cargo; \
   	fi && \
   		export PATH="/usr/local/Cellar/[email protected]/3.9.16/libexec/bin:/usr/local/opt/[email protected]/libexec/bin:/usr/local/opt/[email protected]/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sorenwelling/.cargo/bin/:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/sorenwelling/.cargo/bin:/usr/ucb:/Users/sorenwelling/Applications/quarto/bin:/usr/texbin:/Applications/RStudio.app/Contents/Resources/app/quarto/bin:/Applications/RStudio.app/Contents/Resources/app/bin/postback:/Users/sorenwelling/.cargo/bin" && \
   		cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target
       Updating crates.io index
       Updating git repository `https://github.com/extendr/extendr`
       Updating git repository `https://github.com/RustAudio/rodio.git`
      Compiling proc-macro2 v1.0.58
      Compiling quote v1.0.27
      Compiling unicode-ident v1.0.9
      Compiling autocfg v1.1.0
      Compiling cfg-if v1.0.0
      Compiling syn v1.0.109
      Compiling log v0.4.17
      Compiling libc v0.2.144
      Compiling bitflags v1.3.2
      Compiling lazy_static v1.4.0
      Compiling memchr v2.5.0
      Compiling glob v0.3.1
      Compiling arrayvec v0.7.2
      Compiling num-traits v0.2.15
      Compiling num-integer v0.1.45
      Compiling clang-sys v1.6.1
      Compiling minimal-lexical v0.2.1
      Compiling version_check v0.9.4
      Compiling libloading v0.7.4
      Compiling nom v7.1.3
      Compiling encoding_rs v0.8.32
      Compiling bindgen v0.64.0
      Compiling regex-syntax v0.7.2
      Compiling lock_api v0.4.9
      Compiling syn v2.0.16
      Compiling parking_lot_core v0.9.7
      Compiling peeking_take_while v0.1.2
      Compiling shlex v1.1.0
      Compiling lazycell v1.3.0
      Compiling rustc-hash v1.1.0
      Compiling scopeguard v1.1.0
      Compiling semver v1.0.17
      Compiling smallvec v1.10.0
      Compiling core-foundation-sys v0.6.2
      Compiling signal-hook v0.3.15
      Compiling cexpr v0.6.0
      Compiling parking_lot v0.12.1
      Compiling regex v1.8.2
      Compiling num-complex v0.4.3
      Compiling rustfft v6.1.0
      Compiling signal-hook-registry v1.4.1
      Compiling rustversion v1.0.12
      Compiling strength_reduce v0.2.4
      Compiling transpose v0.2.2
      Compiling rustc_version v0.4.0
      Compiling primal-check v0.3.3
      Compiling ahash v0.8.3
      Compiling mio v0.8.6
      Compiling matrixmultiply v0.3.7
      Compiling once_cell v1.17.1
      Compiling cpal v0.15.2
      Compiling signal-hook-mio v0.2.3
      Compiling arrow2 v0.17.1
      Compiling mach2 v0.4.1
      Compiling getrandom v0.2.9
      Compiling bytemuck_derive v1.4.1
      Compiling futures-core v0.3.28
      Compiling heck v0.4.1
      Compiling core-foundation-sys v0.8.4
      Compiling dasp_sample v0.11.0
      Compiling rawpointer v0.2.1
      Compiling crossterm v0.25.0
      Compiling chrono v0.4.24
      Compiling bytemuck v1.13.1
      Compiling symphonia-core v0.5.2
      Compiling simdutf8 v0.1.4
      Compiling strum_macros v0.24.3
      Compiling either v1.8.1
      Compiling hash_hasher v2.0.3
      Compiling strum v0.24.1
      Compiling symphonia-metadata v0.5.2
      Compiling symphonia-utils-xiph v0.5.2
      Compiling symphonia-format-mkv v0.5.2
      Compiling symphonia-bundle-flac v0.5.2
      Compiling symphonia-codec-vorbis v0.5.2
      Compiling symphonia-format-ogg v0.5.2
      Compiling symphonia-format-wav v0.5.2
      Compiling symphonia-codec-adpcm v0.5.2
      Compiling symphonia-codec-pcm v0.5.2
      Compiling foreign_vec v0.1.0
      Compiling strsim v0.10.0
      Compiling ident_case v1.0.1
      Compiling libR-sys v0.4.0
      Compiling unicode-width v0.1.10
      Compiling ethnum v1.3.2
      Compiling dyn-clone v1.0.11
      Compiling fnv v1.0.7
      Compiling futures-task v0.3.28
      Compiling darling_core v0.14.4
      Compiling comfy-table v6.1.4
      Compiling symphonia v0.5.2
      Compiling ndarray v0.15.6
      Compiling futures-util v0.3.28
      Compiling futures-channel v0.3.28
      Compiling coreaudio-sys v0.2.12
      Compiling futures-sink v0.3.28
      Compiling pin-project-lite v0.2.9
      Compiling pkg-config v0.3.27
      Compiling realfft v3.2.0
      Compiling libsoxr-sys v0.1.4
      Compiling rubato v0.12.0
      Compiling tokio v1.28.1
      Compiling pin-utils v0.1.0
      Compiling async-trait v0.1.68
      Compiling thiserror v1.0.40
      Compiling darling_macro v0.14.4
      Compiling darling v0.14.4
      Compiling tokio-macros v2.1.0
      Compiling thiserror-impl v1.0.40
   error: failed to run custom build command for `libsoxr-sys v0.1.4`
   
   Caused by:
     process didn't exit successfully: `/Users/sorenwelling/Documents/projs/harmonium/r-harmonium/src/./rust/target/release/build/libsoxr-sys-58fccd8037b6ba39/build-script-build` (exit status: 101)
     --- stdout
     cargo:rerun-if-env-changed=SOXR_NO_PKG_CONFIG
     cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
     cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
     cargo:rerun-if-env-changed=HOST_PKG_CONFIG
     cargo:rerun-if-env-changed=PKG_CONFIG
     cargo:rerun-if-env-changed=SOXR_STATIC
     cargo:rerun-if-env-changed=SOXR_DYNAMIC
     cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
     cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
     cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-apple-darwin
     cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_apple_darwin
     cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
     cargo:rerun-if-env-changed=PKG_CONFIG_PATH
     cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-apple-darwin
     cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_apple_darwin
     cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
     cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
     cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
     cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
     cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
     cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
   
     --- stderr
     thread 'main' panicked at '`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "soxr"` did not exit successfully: exit status: 1
     error: could not find system library 'soxr' required by the 'libsoxr-sys' crate
   
     --- stderr
     Package soxr was not found in the pkg-config search path.
     Perhaps you should add the directory containing `soxr.pc'
     to the PKG_CONFIG_PATH environment variable
     No package 'soxr' found
     ', /Users/sorenwelling/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsoxr-sys-0.1.4/build.rs:15:18
     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
   warning: build failed, waiting for other jobs to finish...
   make: *** [rust/target/release/libharmonium.a] Error 101
   ERROR: compilation failed for package ‘harmonium’
─  removing ‘/private/var/folders/v1/b2c26lpn2yjd997jg_gn4fgc0000gn/T/RtmpMFYAvn/devtools_install_62a166beb3bb/harmonium’
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'R' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Type .Last.error to see the more details.
´´´

use `if let Some(x) = arr.dim()` instead of checking `is_array`

fn new_from_values(arr: Robj, dtype: &HDataType) -> Robj {
    assert!(arr.is_array());

    // Ok to unwrap since it was checked that robj is an array.
    let mut dim: Vec<usize> = arr
        .dim()
        .unwrap()
        .iter()
        .map(|z| z.inner() as usize)
        .collect();
    dim.reverse();

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.