Convert recorded sound file to flac format (xamari

2019-05-28 12:54发布

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

2条回答
疯言疯语
2楼-- · 2019-05-28 13:05

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.

查看更多
Deceive 欺骗
3楼-- · 2019-05-28 13:16

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

查看更多
登录 后发表回答