Search code examples
c#.netmp3flac

.NET: How can I convert an mp3 or a wav file to .flac


I need to write a utility in c# that uses Google Speech Api to convert speech from an audio file into text. As far as I know, Google only accepts .flac format for this api. Unfortunately, I have .wav and .mp3 audio files. So I am trying to find out if there is a way for me to convert mp3 to flac in .NET. I looked at NAudio, but it doesn't seem to be working with flac files.


Solution

  • I ended up using Gregory S. Chudov's C# implementation of FLAKE encoder. You can find more information at http://www.hydrogenaudio.org/forums/index.php?showtopic=74242

    There is another project on BitBucket that uses CUETools FLAKE in its Google Speech Api wrapper. It is a good starting point for implementing speech to text using Google speech api. You can find it at https://bitbucket.org/josephcooney/cloudspeech

    I was able to convert wav to flac without much difficulty using the FLAKE encoder. Hope this helps you.