Toggle audio recording (for use with hotkeys and stuff)

Using the CodeScript Toolkit plugin, you can put a .js file in whatever folder you set as the “Invocable scripts folder.” Then, you can assign a hotkey to that script[1].

This script toggles the audio recorder.

exports.invoke = async (app) => {
  if (app.internalPlugins.plugins["audio-recorder"].instance.recording) {
    app.commands.executeCommandById('audio-recorder:stop');
    new Notice('⏹️ Recording stopped');
  } else {
    app.commands.executeCommandById('audio-recorder:start');
    new Notice('🔴 Recording started');
  }
};

Related feature request:


  1. It also is available as an Obsidian command, so you can have other ways of triggering it, too. ↩︎