I record the sound of on iPhone using AvAudioRecorder
(xamarin). How convert audio file to .FLAC format using C# (for google speech api) ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
There are number of open source C# managed encoders, please check FlacBox or C# Flake. See also Discussion on the latter