We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Audio Preprocessing Extension
#1
Rainbow 
Hi all,

What is your opinion on creating a extension for audio preprocessing to use it in neural networks and training purposes. Is it worth making a extension for it or is it better to resort to other languages like python?

Thank you.
Reply
#2
Hi,

In general I would probably recommend Python for this kind of thing, if the objective is to use existing libraries.  For example https://github.com/abishek-as/Audio-Clas...p-Learning

Extensions for Small Basic are mostly based on .Net libraries unless written from scratch, are there any of these you have in mind.

There is already LDSpeech.Listen that can recognise simple spoken phrases.

I guess it depends on what you want to do as objective - learn about sound processing, ANNs - or have a working solution for a specific task.

Ultimately it depends on what kind of audio preprocessing you want and what libraries exist for it, or even it you want to write them yourself at a low level in some way.
[-] The following 1 user Likes litdev's post:
  • hybridClasher.init()
Reply
#3
Is This What You Mean.

Audio processing, often referred to as digital signal processing, is a technique used to manipulate an audio signal. This manipulation can include tasks like amplifying the signal, filtering out unwanted noise, or converting the audio signal from analog to digital and vice versa.

What is Audio Processing? | OrNsoft - AI Software Development ...
www.ornsoft.com/blog/what-is-audio-processing/

If You Want An Extension Then I Found One Library For CSharp:CSCore
https://www.nuget.org/packages/CSCore/
ZS
Reply
#4
It means that we can convert raw audio data to a type of data that a ANN can understand. However, im not sure if SmallBasicANN is capable of training voice models, let alone even a audio extension that can process training data. Extensions like Microsoft.ML (.NET) and PyTorch (Python) can be used for other languages like C#, or VB.net. Im aiming to create a AI Voice Model Trainer in small basic, which can take .wav audio files and train them as a voice model to use for songs, music, etc. An example of a full-fledged popular website that can do this is weights.gg

I'll see if i can make one with SharpDevelop. Though i'm not sure if im good enough at C# for that.  Big Grin
Reply
#5
Hi, sounds interesting - my advice is to do a chunk of goggling and reading first, then if a library looks like it can do what you want consider testing it in C# with a very simple test to make sure the basics work.  Then you can consider writing an API so it can be used in Small Basic.

One of the challenges I have found is provide sufficient functionality so it has real value in SB, but not to add every feature and over-whelm it - frankly if some-one wants every last feature they should do it C# or whaterver native language the library is in.

I think the SB ANN module is quite nice so I would think worth the effort trying - I've done a few small tests with it which work well, I plan to maybe try something a bit bigger (more inputs) perhaps with images to see how far we can push it.

At any point we can help with any of it - I like these projects Smile
[-] The following 1 user Likes litdev's post:
  • hybridClasher.init()
Reply
#6
Rainbow 
I've found a popular .net library called NAudio that provides advanced audio features, including preprocessing. However after looking at it's syntax I was kinda backed down from the idea of compiling a extension for this...  Big Grin
Though nevertheless i'm bad at c# coding so if my code doesnt work then i'll probably resort to making the app in python (thats the whole reason i moved to small basic)... Although i'll try my best and wont let this project down!  Smile
Reply
#7
NAudio does look quite daunting, too big to wholly create an SB extension for - what are the specific bits of its functionality that you would want to use.  I don't actually see anything that  clearly helps with pre-processing for ANN.

The first really important part is being very clear about the scope of the project and finding something that can do the required work under the hood - the easy bit will be actually hooking it up to use in SB as an extension (because we can help with that).
Reply
#8
Hi,
I watched your old youtube tutorial on how to create sb extensions, which gave me some type of guidance. I'll explain the process on how my extension will work. There will be a input path to a .wav audio file and the extension will convert it to training data, as SmallBasicANN (or any other neural network even) cannot use raw audio files as training data. It can be converted to a txt file, or csv file (maybe using the function you just added to LDFile) and use it to train the model. Im not much familiar with NAudio, as I just heard about it as a popular package, so sorry for any misconceptions. I'll create the extension using VB.net as im not much familiar with C#.
[-] The following 1 user Likes hybridClasher.init()'s post:
  • litdev
Reply
#9
If you can use Visual Studio 2022 Community, I would use this in place of SharpDevelop.  The main reason for Z-S to use ShartpDevelop is that is is much smaller and uses less Ram etc.  Functionality it is very similar, but with VS getting external libraries (NuGet) or cross platform development (.Net 8) is easier.  It is also fully supported, regularly updated and you will find much more www support for it.

VB or C# are very similar functionally, just different syntax.  The main reason I tend to recommend C# is that its syntax is much closer to other languages like C++, Java, php or even Python so easier to transfer between them than from VB, but as I say the functionality is similar so VB is great if you are more comfortable with it.

As with AbsoluteBegginer's work wanting to use ANN for rabbit/snake AI game, I suggested he started with simple ANN test training to get an idea how it works before trying to use it for final objective.

Good luck and keep us informed of progress, maybe we can help along the way!
[-] The following 1 user Likes litdev's post:
  • hybridClasher.init()
Reply
#10
Hi, thank you for the recommendation of VS 2022.
I'm happy to announce that the extension is done, though there is one problem. I'm not much familiar with xml editing, and there isn't any IntelliSense description of the extension... its only one class and one method, which is: AudioPreprocessorExtension.ConvertWavToTrainingData(inputFile,outputFile)

There are two arguments, first one is the input path to the wav file, and the second one is the output path to the converted file (the format can be anything e.g txt or csv, although for my ai project im currently using .dat)
Also, the program folder (where the sb file is compiled) needs the NAudio.dll and NAudio.Core.dll files to be manually added, which im not sure why they dont appear in my program folder when i compile my code in sb-prime (the lib folder already has the necessary naudio dlls)

Heres the link to my extension (your website doesn't allow .zip or .dll files): https://drive.google.com/file/d/1UDd2k8K...YauDI/view

If you have any ideas/suggestions on how to fix these problems or if there should be more methods in the extensions, let me know.
Thanks.

P.S Since SmallBasicANN is kinda limited, i'll probably make a TensorFlow.NET extension too someday, but i'll think about it.  Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)