Giter Site home page Giter Site logo

aubio.net's Introduction

aubio.net

This is aubio for .NET Standard, it works for desktop apps as well as store apps.

All stable types are available as .NET types, leveraging features like LINQ, IEnumerable, IDisposable, typed-approach etc.

It still needs some polishing so expect some minor adjustments to the API (read here it's not yet ready), for the documentation you will have to refer to https://aubio.org/documentation for the time being.

Your feedback is welcome !

'develop' branch

This branch has the latest changes:

  • better interface
  • AnyCPU support
  • compatibility with UWP restored
  • a few samples

Notes

UWP

Referencing the library

Since Aubio.NET is a .NET Standard 2.0 library, your application must target FCU, see https://blogs.msdn.microsoft.com/dotnet/2017/08/25/uwp-net-standard-2-0-preview/.

File access

There is a big catch in using aubio for analyzing files from within UWP apps. The native libraries (libav, libsndfile ...) do open files with functions like fopen, but these methods will be granted with a Permission denied error message whenever you try to open a file in, say, your 'Music' library.

This is because some of the I/O APIs are forbid to execute in arbitrary locations. The 'official', always-working way is StorageFile but obviously it is unknown to aubio. A serious fix would be to have user-defined I/O callbacks available in aubio, but this is highly unlikely anytime soon as it would require significant rework in the library.

Long story short,

The most affordable and readily available fix is simply to copy the file you want to open with Aubio.NET.IO.Source to a location that does not have these restrictions such as ApplicationData.Current.LocalFolder or ApplicationData.Current.TemporaryFolder as laid out in the following example. Similarly, for Aubio.NET.IO.Sink you will want to write to such location first, then move the file to another location. In other terms, this is the concept of temporary file.

UI responsiveness

In addition to the previous section, the operating system can terminate a store-published application whenever it feels its UI is too sluggish. Addressing such issue is typically done using await Task.Run(() => { /* your work */ });, preferably with cancellation and progress reporting for a good UX.


Binaries will be available soon !

aubio.net's People

Contributors

aybe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aubio.net's Issues

Invert ThrowIfNot, correct passing of set_minioi

Hi, thanks for this port of the aubio library API!
I think I have 2 errors to report:

  1. I encounter errors when I try to set any kind of parameters in this line:
    https://github.com/aybe/aubio.net/blob/master/Aubio/AubioObject.cs#L37
    It seems to me this is a mistake as you expect aubio to return true on success, but the functions (as normal in C) return 0 (error code) if everything went fine. Therefore an exception is always raised.

  2. While investigating this I also saw you pass the number of samples on Onset.MinimumInterOnsetInterval but according to the API it wants the milliseconds.

On a side note, could you explain what the Aubio.NET project is about? it seems to me everything is already in the Aubio project?
Also: where did you find libaubio-6.dll ? I found only libaubio-5 (for windows). Did you build it yourself? Which version auf aubio was that?

Can this lib connect to a microphone (on win/linux/mac) and detect sung pitches?

I am looking for a library to use with C# that let's me access microphone devices on different platforms (Win/Linux/Mac).
Furthermore I want to detect the pitch that is sung into the microphone. However, accessing mics in a cross-platform way has priority at the moment.

Can this be done using this lib? If so, could you provide an example please?

Use in Unity

Hey I don't know how possible this is, but have you ever tried using this library in Unity? I've been trying to find a good audio analysis library for Unity for months and have not have much luck with C# libraries, but aubio looks to be one of the best. I know it won't work "out of the box" for it, and I'm the most proficient when it comes to Aubio itself, so I was wondering if you have any idea on how to make this compatible with Unity projects?

System.EntryPointNotFoundException: 'Unable to find an entry point named 'new_aubio_source' in DLL 'aubio'.'

When using Aubio in a new project, I get this error...

System.EntryPointNotFoundException: 'Unable to find an entry point named 'new_aubio_source' in DLL 'aubio'.'

I am a Unity3D programmer and not very familiar with Visual Studio, so the error may be on my part.
I am hoping for a solution ASAP as my app compiles but runs with this error.
This does not involve Unity3D tho, I am not using Unity3D for this project currently.

Thanks :)

macOS and Android|iOS : System.DllNotFoundException: kernel32

Unhandled Exception:
System.DllNotFoundException: kernel32
  at (wrapper managed-to-native) Aubio.NET.Win32.NativeMethods.RemoveDllDirectory(intptr)
  at Aubio.NET.AubioObject+Destructor__.Finalize () [0x00002] in <98b0c1708c7b487493725149fd66588f>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: kernel32
  at (wrapper managed-to-native) Aubio.NET.Win32.NativeMethods.RemoveDllDirectory(intptr)
  at Aubio.NET.AubioObject+Destructor__.Finalize () [0x00002] in <98b0c1708c7b487493725149fd66588f>:0

The use of native Win32 methods is an issue when using on non-Windows platforms.

    [SuppressMessage("ReSharper", "InconsistentNaming")]
    private sealed class Destructor__
    {
        ~Destructor__()
        {
            // TODO this is not triggerred, at least on UWP

            if (!NativeMethods.RemoveDllDirectory(Cookie))
                throw new Win32Exception();
        }
    }

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.