webbingtech / flutter_silk

A flutter ffi plugin for silk to pcm/mp3 .
GNU Lesser General Public License v3.0
0 stars 0 forks source link

flutter_silk

A flutter ffi plugin for converting audio from silk to pcm/mp3. Support Macos, Ios, Linux, Windows and Android.

Usage

final silkData = File("input.silk").readAsBytesSync();
var output = silkToMp3(silkData);
File("output.mp3").writeAsBytesSync(output!);

For a complete example, please go to /example folder.

Project structure

This template uses the following structure:

Binding to native code

To use the native code, bindings in Dart are needed. To avoid writing these by hand, they are generated from the header file (src/flutter_silk.h) by package:ffigen. Regenerate the bindings by running flutter pub run ffigen --config ffigen.yaml.

Invoking native code

Very native functions can be directly invoked from any isolate. For example, see silkToPcm pcmToMp3 silkToMp3 in lib/flutter_silk.dart.

Reference

libSilkCodec

silk

flutter_lame