Skip to content

AudioRecorderPluginInstance

Unofficial

Plugin instance for the audio recorder, providing methods to record and save audio clips.

Import:

import type { AudioRecorderPluginInstance } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface AudioRecorderPluginInstance extends InternalPluginInstance<AudioRecorderPlugin>

Extends: InternalPluginInstance<AudioRecorderPlugin>

Properties

PropertyTypeDescription
appAppReference to the app.
descriptionstringHuman-readable description of this plugin.
(Inherited from InternalPluginInstance)
extensionstringFile extension used for saved audio recordings.
idstringUnique identifier for this plugin.
(Inherited from InternalPluginInstance)
namestringHuman-readable display name of this plugin.
(Inherited from InternalPluginInstance)
pluginAudioRecorderPluginReference to the audio recorder plugin registration.
recorderMediaRecorder | nullActive MediaRecorder instance, or null when not recording.
recordingbooleanWhether audio is currently being recorded.

Methods

MethodReturnsDescription
checkPermission()Promise<boolean>Check if the user has granted microphone permission.
init(app, plugin)voidInitialize the plugin instance with app and plugin references.
(Inherited from InternalPluginInstance)
onDisable(app, plugin)voidCalled when the plugin is disabled.
(Inherited from InternalPluginInstance)
onEnable(app, plugin)Promise<void>Called when the plugin is enabled.
(Inherited from InternalPluginInstance)
onRecordAudio()Promise<void>Initiate the audio recording flow.
onStartRecording()Promise<void>Start a new audio recording session.
onStopRecording()voidStop the current audio recording session.
onUserDisable(app)voidCalled when the user manually disables the plugin.
(Inherited from InternalPluginInstance)
onUserEnable(app)voidCalled when the user manually enables the plugin.
(Inherited from InternalPluginInstance)
saveRecording(audioBuffer)Promise<void>Save the recorded audio buffer to a file in the vault.
showRecordingMessage(message, isError)voidDisplay a recording status message or error to the user.
startRecording(stream)voidBegin recording audio from the given media stream.

Links to this page: