JULIK JULIK - 1 month ago 14
iOS Question

Convert recorded sound file to flac format (xamarin ios)

I record the sound of on iPhone using

AvAudioRecorder
(xamarin). How convert audio file to .FLAC format using C# (for google speech api) ?

Answer

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.

Comments