zig_audio_kit 0.0.4 copy "zig_audio_kit: ^0.0.4" to clipboard
zig_audio_kit: ^0.0.4 copied to clipboard

A lightweight Flutter audio package providing audio recording and playback

Audio Kit #

A lightweight Audio recorder and player for Flutter, built with Zig, miniaudio,webrtc.

Features #

Audio Recorder #

The recorder supports:

  • Start recording to a file
  • Stop recording
  • Pause recording
  • Resume recording
  • File-based recording output
  • Real-time noise filtering using WebRTC

Real-Time Noise Filtering #

The recorder supports real-time noise suppression during recording using a native WebRTC-based noise filter.

Noise filtering is performed on the audio stream in real time before the recorded audio is written to the output file.


Start recording

final input = "/path/to/recording.wav";

AudioRecorder.start(input);

Stop recording

AudioRecorder.stop();

Pause / Resume recording

if (AudioRecorder.isPaused) {
  AudioRecorder.resume();
  print("Recording resumed!");
} else {
  AudioRecorder.pause();
  print("Recording paused!");
}

A typical recording flow is:

AudioRecorder.start(input);

// Pause when required
AudioRecorder.pause();

// Resume when required
AudioRecorder.resume();

// Finish recording
AudioRecorder.stop();

Audio Player #

The player supports:

  • Play an audio file
  • Pause playback
  • Resume playback
  • Restart playback from the beginning
  • Stop playback

Play #

void _play() {
  bool success = AudioPlayer.play(widget.audioFilePath);

  print(widget.audioFilePath);

  if (success) {
    setState(() {
      _isPlaying = true;
      _isPaused = false;
    });
  }

  print("Playback started: $success");
}

Pause #

void _pause() {
  AudioPlayer.pause();

  setState(() {
    _isPlaying = false;
    _isPaused = true;
  });

  print("Playback paused");
}

Resume #

void _resume() {
  AudioPlayer.resume();

  setState(() {
    _isPlaying = true;
    _isPaused = false;
  });

  print("Playback resumed");
}

Restart #

void _restart() {
  AudioPlayer.restart();

  setState(() {
    _isPlaying = true;
    _isPaused = false;
  });

  print("Playback restarted");
}

Stop #

void _stop() {
  AudioPlayer.stop();

  setState(() {
    _isPlaying = false;
    _isPaused = false;
  });

  print("Playback stopped");
}

Platform Support #

The package currently supports:

Platform Status
Android ✅ Supported
Windows ✅ Supported
Linux ✅ Supported
iOS 🚧 Planned

Android CPU / ABI Support #

Native libraries are provided for the following Android ABIs:

jnilibs/
├── arm64-v8a/
├── armeabi-v7a/
└── x86_64/

Supported Android architectures #

ABI CPU
arm64-v8a 64-bit ARM
armeabi-v7a 32-bit ARM
x86_64 64-bit x86

arm64-v8a is recommended for modern Android phones and tablets.


Architecture #

The package uses the following stack:

                  Flutter / Dart
                        │
                     Dart FFI
                        │
          ┌─────────────┴─────────────┐
          │                           │
     Native Audio                WebRTC Noise
        Engine                    Suppression
          │                           │
          └─────────────┬─────────────┘
                        │
                       Zig
                        │
                    miniaudio
                        │
          ┌─────────────┼─────────────┐
          │             │             │
       Android       Windows        Linux
     Audio System   Audio System   Audio System

Future Development #

iOS Support #

iOS support is planned as a future development milestone.

If you find any issues, kindly let me know. #

0
likes
150
points
80
downloads

Documentation

API reference

Publisher

verified publishertokeyan.online

Weekly Downloads

A lightweight Flutter audio package providing audio recording and playback

Homepage

License

Apache-2.0 (license)

Dependencies

ffi, flutter, plugin_platform_interface

More

Packages that depend on zig_audio_kit

Packages that implement zig_audio_kit