I want to obtain an array of frequencies when I input an audio file in C#. I never have done anything related to this topic so i'm a noob. If the question is too broad please help me to narrow it down.
Asked
Active
Viewed 558 times
0
-
Yes, your question is far too broad and also unclear (what do you mean by "an array of frequencies"?) To narrow it down, research the principles of what you want to do (probably spectral analysis) and software that can help you do that (NAudio would be a good starting point). Then try some code, and when that code doesn't work as expected, come back and post your code with a detailed description of what you'd expect and what you get instead. – Frauke May 07 '19 at 07:24
-
In addition to @FraukeNonnenmacher - first thing is to define the format of the audio file... mp3, ogg, wav? – dodgy_coder May 07 '19 at 07:34
-
1I think it is reasonably clear that "array of frequencies" is referring to a Discrete Fourier Transform. It would be more constructive to suggest a [FFT example in C#](https://www.centerspace.net/examples/nmath/csharp/core/fast-fourier-transform-example.php) or [a list of available FFT implementations](https://www.codeproject.com/Articles/1095473/Comparison-of-FFT-Implementations-for-NET) to begin with as a means of having the user clarify their question. I will agree that this is a 2 part problem of 1. extracting audio data from a file and 2. analysing that data. – fdcpp May 07 '19 at 09:06
-
@FraukeNonnenmacher Thankyou for your help. I'll begin with what you suggested and edit the question appropriately. – Lakshith Nishshanke May 07 '19 at 14:38
-
2@dodgy_coder I want to use this data for deep learning model in a Music player. So most of the times I think i'll have to work with mp3 – Lakshith Nishshanke May 07 '19 at 14:40
-
1@fdcpp Thank you for your concern. But I don't have any idea on FFT. I'll try to search the net for it. And as u said extracting audio data is also a problem to me. Can you show me or point me someplace to learn that. thank you – Lakshith Nishshanke May 07 '19 at 14:49
-
It sounds like you are aiming to do [Music Information Retrieval](https://en.wikipedia.org/wiki/Music_information_retrieval#Music_generation) which is It’s own field and I would say it is outside the scope of a single SO question. – fdcpp May 07 '19 at 15:14
-
For some technical steps, I would look at these SO posts:[How to play mp3 files in C#?)](https://stackoverflow.com/questions/3129361/how-to-play-mp3-files-in-c), [An implementation of the fast Fourier transform (FFT) in C#](https://stackoverflow.com/questions/170394/an-implementation-of-the-fast-fourier-transform-fft-in-c-sharp), [How to Extract an MFCC using C#](https://stackoverflow.com/questions/3964173/how-to-extract-an-mfcc-using-c-sharp), [Audio descriptor MFCC in C#](https://stackoverflow.com/questions/37367549/audio-descriptor-mfcc-in-c-sharp). – fdcpp May 07 '19 at 15:14
-
1Consult your institute's informatics, Acoustics or computational linguistics departments. If you are not part of an institute, I'd say this is the time to go back to school. – fdcpp May 07 '19 at 15:14
-
1@fdcpp You are a lot of help of me. I really appreciate that. Oh and about the school, I'm 16 so no need to go back, i'm still in school ;) – Lakshith Nishshanke May 08 '19 at 18:37
-
1@fdcpp I have made a double array from the wav file. And then I applied fft to it. then I got output of complex array. What are those numbers in complex array mean? are they the frequencies? thankyou – Lakshith Nishshanke May 09 '19 at 18:02
-
@LakshithNishshanke I'd say that was outside of the topic of this question. Have a read of [this Discrete Fourier Transform SO question](https://math.stackexchange.com/questions/2809394/can-someone-clearly-explain-the-discrete-fourier-transform-dft). I would suggest speaking to your maths department. – fdcpp May 10 '19 at 15:44
-
Check This : [https://stackoverflow.com/questions/45996622/get-information-like-pitch-or-amplitude-from-audio-byte-in-an-array/45996760](https://stackoverflow.com/questions/45996622/get-information-like-pitch-or-amplitude-from-audio-byte-in-an-array/45996760) – Buddhika Bandara May 12 '20 at 13:15