Skip to content

Commit

Permalink
Merge pull request #14 from deepgram-devs/quick-note-adds
Browse files Browse the repository at this point in the history
Added Readme update. Added command to run audio note
  • Loading branch information
jjmaldonis authored Feb 22, 2023
2 parents 7decb74 + b2337c7 commit 6302d93
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,15 @@ After I have replied to you, you'll be able to subscribe on [Ko-Fi](https://ko-f
I will then send you an API key to use, and you'll be able to start generating transcripts!

If you are overloading the service, I may ask you to slow down your requests so other people can use the service and get their transcripts quickly.

## Quick Audio Notes

Obsidian provides a Core plugin called Audio Recorder which is pretty cool, but it lacks some features. We've expanded on that idea by giving the ability to get transcripts of your audio added directly to the notes. You also have the ability to pause and resume the recording incase you get interupted mid-recording.

### Usage

First, you'll need an API Key from [Deepgram AI](https://dpgr.am/obsidian). It does cost money, but it is really affordable. They also give you up to 12,000 minutes of free transcription for free as part of the trial period, depending on which additional options you select. Add that to the Deepgram API Key setting inside the plugin settings once you have it.

You can then either use the command `Generate quick audio recording with transcription`, or you can click the microphone icon in the side ribbon. This will pop open a modal giving you the options to select for the transcription. (To learn more about each option, visit their respective links in the modal.) After checking the options you want added, you can hit the green microphone button to start the recording.

When you are done recording, hit the stop button. It will take a few seconds for the transcription to be ready, when it is you can hit the "Save" button and the audio and transcription will get added to your document.
2 changes: 1 addition & 1 deletion src/DGQuickAudioNote.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
export let recorder: MediaRecorder | undefined;
export let gumStream: MediaStream | undefined;
export let extension: any;
export let modal = Modal;
export const modal = Modal;
if (MediaRecorder.isTypeSupported("audio/webm;codecs=opus")) {
extension = "webm";
} else {
Expand Down
23 changes: 18 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ import {
getAudioPlayerIdentify,
getStartAndEndFromBracketString,
} from "./AudioNotes";
import {
Transcript,
parseTranscript,
TranscriptsCache,
} from "./Transcript";
import { Transcript, parseTranscript, TranscriptsCache } from "./Transcript";

// Load Font-Awesome stuff
import { library } from "@fortawesome/fontawesome-svg-core";
Expand Down Expand Up @@ -572,6 +568,23 @@ export default class AutomaticAudioNotes extends Plugin {
},
});

this.addCommand({
id: "quick-audio-note",
name: "Generate quick audio recording with transcription",
callback: async () => {
if (
this.settings.DGApiKey === "" ||
this.settings.DGApiKey === undefined
) {
new Notice(
"Please set your Deepgram API key in the settings tab."
);
} else {
new DGQuickNoteModal(this).open();
}
},
});

// Register the HTML renderer.
this.registerMarkdownCodeBlockProcessor(`audio-note`, (src, el, ctx) =>
this.postprocessor(src, el, ctx)
Expand Down

0 comments on commit 6302d93

Please sign in to comment.