#tauri-plugin #audio-recording #tauri #microphone-recording

sys tauri-plugin-mic-recorder

Supports recording audio using a microphone and saving the recorded data as a file

1 stable release

2.0.0 Mar 18, 2025

#1359 in GUI

Download history 91/week @ 2025-03-17

91 downloads per month

MIT license

71KB
263 lines

tauri-plugin-mic-recorder

This plugin only works on tauri v2, if you need the v1 plugin, feel free to submit a PR!

Supports recording audio using a microphone and saving the recorded data as a file.

https://github.com/user-attachments/assets/7c6f1df4-96e6-4cac-806b-098e8bccc1f7

Platform Support

Platform Supported
Windows
macOS
Linux
Android
iOS

Install

cargo add tauri-plugin-mic-recorder

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add tauri-plugin-mic-recorder-api

Usage

src-tauri/src/lib.rs

pub fn run() {
    tauri::Builder::default()
+       .plugin(tauri_plugin_mic_recorder::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

src-tauri/capabilities/default.json

{
    ...
    "permissions": [
        ...
+       "mic-recorder:default"
    ]
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { startRecording } from "tauri-plugin-mic-recorder-api";

startRecording();

Methods

Method Description
startRecording Starts recording audio.
stopRecording Stops recording audio.

Example

git clone https://github.com/ayangweb/tauri-plugin-mic-recorder.git
pnpm install

pnpm build

cd examples/tauri-app

pnpm install

pnpm dev

Thanks

  • Use cpal and hound record and generate wav files.

Who's Use It

  • Coco AI - Search, Connect, Collaborate, Your Personal AI Search and Assistant, all in one space.

Dependencies

~21–57MB
~1M SLoC