As I understand it, in order to work with sound, you need to decompose it into a spectrum using a Fourier series. Suppose I have some kind of sound file (mp3 or wav). How can I pull the data from there to decompose into a spectrum using the Fourier transform? Or is this process done differently? And what libraries should be used for this (with ++ or Js) precisely for obtaining raw data. I know there are ready-made libraries for decomposition in a row, but the process itself is interesting to me.
- I read on Wikipedia what the Fourier Series is. If you grasp the formulas that are presented there, you can decompose into a spectrum without libraries. I myself asked this question, but there was always not enough time. But in the files of the usual WAV format, the sound data is stored in uncompressed and unencrypted form, they can be extracted without special functions and in many languages. - Oleg
|
1 answer
You already asked here today, in my code there are such lines:
data_L = buffer.getChannelData(0); data_R = buffer.getChannelData(1); These are one-dimensional arrays with raw data obtained for the left and right audio channels. This data is also called samples. But the function BaseAudioContext.createAnalyser () will help expand the sound file into a spectrum
|