mirror of
https://github.com/mossy1022/Smart-Memos.git
synced 2026-07-22 10:30:29 +00:00
Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f66c80de83 | ||
|
|
523376c46b | ||
|
|
6455c243dd | ||
|
|
eb2a195ad6 | ||
|
|
b6800d50ea | ||
|
|
84d2d32077 |
6 changed files with 27 additions and 7 deletions
|
|
@ -28,8 +28,8 @@ Note* This plugin currently uses online openAI models to recieve and transcribe
|
|||
## Usage
|
||||
Once installed, the Smart Memos Plugin provides an intuitive interface to transcribe your audio files and generate notes.
|
||||
|
||||
- **Adding Audio**: To speak your memo directly into Obsidian, tap the microphone icon to open the smart memos popup that'll automatically start recording. To import audio into a note, simply drag and drop the file into it.
|
||||
- **Transcribing Audio**: To transcribe an audio file after it's been imported into a note, move your cursor right underneath the audio file and use the command `Smart transcribe` from the command palette (`Ctrl + p` for Windows and `Cmd + p` for Mac). The plugin will transcribe the audio file and generate detailed notes. If you're speaking directly to Obsidian, you can select the "Smart Transcribe" button to transcribe what you've recorded.
|
||||
- **Adding Audio**: Ensure you have a note opened. To speak your memo directly into Obsidian, tap the microphone icon or use the command `Record smart memo` from the command pallet (`Ctrl + p` for Windows and `Cmd + p` for Mac) to open the smart memos popup that'll automatically start recording. To import audio into a note, simply drag and drop the file into it.
|
||||
- **Transcribing Audio**: To transcribe an audio file after it's been imported into a note, move your cursor right underneath the audio file and use the command `Smart transcribe` from the command palette. The plugin will transcribe the audio file and generate detailed notes. If you're speaking directly to Obsidian, you can select the "Smart Transcribe" button to transcribe what you've recorded.
|
||||
- **Customizing the Prompt**: You can customize the prompt that will be sent to the AI model before adding your transcribed audio in the plugin settings.
|
||||
- **Include Raw Transcript**: If you just want clean notes returned, you can remove the addition of the raw transcript at the end by toggling it off in the settings
|
||||
|
||||
|
|
|
|||
14
Utils.ts
14
Utils.ts
|
|
@ -2,8 +2,18 @@ import { App, TFile, TFolder, normalizePath } from 'obsidian';
|
|||
|
||||
export async function saveFile(app: App, audioBlob: Blob, fileName: string, path: string): Promise<TFile> {
|
||||
try {
|
||||
const normalizedPath = normalizePath(path);
|
||||
const filePath = `${normalizedPath}/${fileName}`;
|
||||
|
||||
let normalizedPath: string;
|
||||
try {
|
||||
normalizedPath = normalizePath(path);
|
||||
if (!normalizedPath) {
|
||||
console.warn('Normalized path is invalid, using root path');
|
||||
normalizedPath = '/'; // Set to root path of the vault
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Error normalizing path, using root path:', error);
|
||||
normalizedPath = '/'; // Set to root path of the vault
|
||||
} const filePath = `${normalizedPath}/${fileName}`;
|
||||
|
||||
await ensureDirectoryExists(app, normalizedPath);
|
||||
|
||||
|
|
|
|||
11
main.ts
11
main.ts
|
|
@ -61,6 +61,16 @@ export default class SmartMemosPlugin extends Plugin {
|
|||
}
|
||||
});
|
||||
|
||||
// Add the record smart memo command
|
||||
this.addCommand({
|
||||
id: 'record-smart-memo',
|
||||
name: 'Record smart memo',
|
||||
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
||||
// Open the audio recorder and store the recorded audio
|
||||
this.audioFile = await new SmartMemosAudioRecordModal(this.app, this.handleAudioRecording.bind(this)).open();
|
||||
}
|
||||
});
|
||||
|
||||
this.registerMarkdownPostProcessor((el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
const audioLinks = el.querySelectorAll('a.internal-link[data-href$=".wav"]');
|
||||
console.log('audio links: ', audioLinks);
|
||||
|
|
@ -97,7 +107,6 @@ export default class SmartMemosPlugin extends Plugin {
|
|||
|
||||
|
||||
// Add the audio recorder ribbon
|
||||
// Update the callback for the audio recorder ribbon
|
||||
this.addRibbonIcon('microphone', 'Record smart memo', async (evt: MouseEvent) => {
|
||||
// Open the audio recorder and store the recorded audio
|
||||
this.audioFile = await new SmartMemosAudioRecordModal(this.app, this.handleAudioRecording.bind(this)).open();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "smart-memos",
|
||||
"name": "Smart Memos",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Create personalized and intelligent analysis, summaries, and more for audio recordings that can be imported or spoken directly into a note",
|
||||
"author": "Evan Moscoso",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "smart-memos",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "Create personalized and intelligent analysis, summaries, and more for audio recordings that can be imported or spoken directly into a note",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
1
whisper.cpp
Submodule
1
whisper.cpp
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c118733a29ad4a984015a5c08fd585086d01087a
|
||||
Loading…
Reference in a new issue