Create mp3 file from scratch C #

As part of some experiments, I thought of something, how can I create a .mp3 file from scratch in C #, which actually sounds somehow, for example, create an mp3 file that plays a note: C # or B flat?

How can I achieve this, and it should be an mp3 file, not a wav or something else.

+3
source share
2 answers

So, I can’t give you the exact code, but I can give you a starting point.

So basically steps will be

  • Find the frequency of the desired wave. Take a look. C # (a good choice by the way!) - 17.32HZ
  • Convert the frequency to LPCM , which is just a series of amplitude values.
  • Convert the encoded LPCM array to an MP3 file. This is probably the most difficult, but LPCM forms the basis of the WAV format , and there are converters for converting to MP3. Look at the found NAudio baalazamon. It supports PCM.
+5
source

I would try using NAudio so that it is powerful enough. The main goal is to manipulate audio files, but it's worth a try.

+1
source

All Articles