.NET: How to convert mp3 or wav file to .flac

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

+4
source share
2 answers

I ended up using the C # CREGREG CORE Gregory S. Chudov implementation. You can find more information at http://www.hydrogenaudio.org/forums/index.php?showtopic=74242

BitBucket has another project that uses CUETools FLAKE in its Google Speech Api shell. This is a good starting point for realizing speech in text using the Google speech api. You can find it at https://bitbucket.org/josephcooney/cloudspeech

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

+1
source

Take a look at http://naudio.codeplex.com/

NAudio is an open source .NET audio and MIDI library containing dozens of useful audio related classes designed to accelerate the development of audio related utilities in .NET. It has been under development since 2002 and has grown to a wide range of functions. Although some parts of the library are relatively new and incomplete, more mature functions have undergone rigorous testing and can be quickly used to add audio capabilities to an existing .NET application. NAudio can be quickly added to a .NET application using NuGet.

Edit Unfortunately, FLAC is not supported there, as I see in the review. Try it yourself.

-1
source

Source: https://habr.com/ru/post/1491302/


All Articles