1

I am writing a cross-platform application for Android, iOS and Windows (Universal) with Xamarin.Forms. Within the application i am trying to implement speech-to-text (in the Dutch language).

At this point i have that my application can record audio files on all platforms however the audio files are not recorded in the correct format for the Cloud Speech API that i am working with. For the API you need to send audio files in the format .Flac, however the audio recorders on the mobile platforms don't support audio recording in the format .Flac.

I am trying to convert the audio recording that is now recorded as a .Wav file the audio file to the .Flac format, however i have not had any success as of jet.

i am trying to use the JavaFlacEncoder, however i am not sure if it would work on within Xamarin on all platforms because it is a Java class.

Could someone help me or give me advise with converting a audio file from .Wav to .Flac?

Thanks in advance.

Michael

Community
  • 1
  • 1
MagicWeed
  • 11
  • 4

2 Answers2

0

There are number of open source C# managed encoders, please check FlacBox or C# Flake. See also Discussion on the latter

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
0

You do not need to send flac files to the Google Speech engine. It reads LPCM files as well. LPCM files are WAV files. All you need to know is the bitrate at which your WAV file is sampling. The the basic options can be set as follows:

encoding: 'LINEAR16',
sampleRate: 16000 //<- whatever your sample rate is
Max Phillips
  • 6,991
  • 9
  • 44
  • 71