I record the sound of on iPhone using AvAudioRecorder
(xamarin). How convert audio file to .FLAC format using C# (for google speech api) ?
Asked
Active
Viewed 766 times
2

Artem Polishchuk
- 505
- 5
- 17
-
AFAIK there is no built in way to do this. You'll have to use some third party library or write the code to do it yourself. – Jason Jun 05 '14 at 16:53
-
Also related http://stackoverflow.com/questions/9733064/how-to-convert-the-wav-ogg-file-to-flac-file-in-android – Nikolay Shmyrev Oct 25 '16 at 16:50
2 Answers
0
There isn't a C# wav-to-flac converter right now.
You could simply use FLACiOS with wav-to-flac files embedded into a project in xcode.
Then use native binding of
public partial class NativeMethods
{
[DllImport("__Internal",
EntryPoint="convertWavToFlac",
CallingConvention = CallingConvention.Cdecl)]
public static extern int FlacEncode(
[MarshalAs(UnmanagedType.LPStr)] string wav_file,
[MarshalAs(UnmanagedType.LPStr)] string flac_file) ;
}
and just use bound native method to convert your wav to flac.

Maxim V. Pavlov
- 10,303
- 17
- 74
- 174
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