silk_decoder 0.0.2 copy "silk_decoder: ^0.0.2" to clipboard
silk_decoder: ^0.0.2 copied to clipboard

A Dart library for decoding SILK audio files to PCM format using native bindings, with asynchronous support to avoid blocking the main thread.

Silk Decoder #

A Dart library for decoding SILK audio files to PCM format using native bindings, with asynchronous support to avoid blocking the main thread.

Basic Example #

import 'package:your_package/silk_decoder.dart';

void main() async {
  // Decode a SILK file to PCM
  final inputPath = 'path/to/input.silk';
  final outputPath = 'path/to/output.pcm';
  final sampleRate = 44100; // Desired output sample rate

  try {
    final result = await decodeSilkFileAsync(inputPath, outputPath, sampleRate);
    if (result == 0) {
      print('Decoding successful! PCM file saved to $outputPath');
    } else {
      print('Decoding failed with error code: $result');
    }
  } catch (e) {
    print('Error during decoding: $e');
  }
}

API Reference #

decodeSilkFileAsync #

Future<int> decodeSilkFileAsync(
  String inputPath,
  String outputPath,
  int sampleRate,
)

Parameters:

  • inputPath: Path to the input SILK file (String)
  • outputPath: Path where the output PCM file will be saved (String)
  • sampleRate: Desired sample rate for the output PCM (int)

Returns:

A Future<int> that completes with:

  • 0: Decoding successful
  • Non-zero: Error code

Acknowledgments #

  • Original work associated with kn007's blog.
  • Copyright holder: Karl Chen (2020).

This project uses the silk-v3-decoder library in compliance with its MIT License, acknowledging the contributions of the original authors and maintainers.

0
likes
150
points
191
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart library for decoding SILK audio files to PCM format using native bindings, with asynchronous support to avoid blocking the main thread.

Homepage
Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ffi, flutter, plugin_platform_interface

More

Packages that depend on silk_decoder