aybe / aubio.net

aubio for .NET
13 stars 9 forks source link

Byte array input instead of file #10

Closed Versette closed 2 years ago

Versette commented 2 years ago

Is there any way to use Aubio.NET.Detection.Pitch with input from a byte array instead of Source from URI?

aybe commented 2 years ago

If you're talking about this constructor:

https://github.com/aybe/aubio.net/blob/b36ad90c392bcf2bb43a85423e5399006af32386/Aubio/Detection/Pitch.cs#L12

Then it's not the path to a file, it's the algorithm to choose from one of these:

https://github.com/aybe/aubio.net/blob/b36ad90c392bcf2bb43a85423e5399006af32386/Aubio/Detection/PitchMethods.cs#L6

Look at the following tempo example but replace tempo by pitch:

https://github.com/aybe/aubio.net/blob/master/Aubio.NET.TestTempo/Program.cs

Versette commented 2 years ago

I am not talking about any of that, sorry for not adding additional information to my question. I want to use aubio for realtime pitch tracking, I get data from the microphone with NAudio, and that gives me a byte array buffer of around 100ms with sound from the mic. So I want to use input from a buffer like that, instead of a file, to get realtime pitch data.