Podcast Voice Notes
This article details the workflow I set up to easily record voice notes while listening to podcasts and store them in obsidian.
Overall Workflow:
- Get a button on top of preferred podcast app. Click it to record voice note.
- Note will get transcribed and saved to obsidian.
- Templater script to organize all podcast voice notes.
Implementation:
Create Android Automate App Flow:
- Install the Automate app in android: Automate - Apps on Google Play
- Create the following flow:
- Create the following flow:
Module | Purpose | Input Arguments/Options/Output Variables |
---|---|---|
Speech Recognition | record voice note and transcribe NOTE: Added 3 modules as each module seems to stop within 2-3 sec irrespective of the time set in its params. |
Output Variables: Array of spoken texts = spoken_text |
Write file | write note to podcast_voice_notes.md file in obsidian vault |
Input Arguments: Content: <br>"\n\n---\n" ++ dateFormat(Now, "datetime") <br>++ "\n\n" ++ spoken_text[0] ++ " " ++ <br>spoken_text2[0] ++ " " ++ spoken_text3[0]<br> File: <PATH_TO>/podcast_voice_notes.md" - Set "Append to file" to true |
Has notification | Check if podcast app has notification on. If so, get podcast and episode names. |
Options: - Proceed: "Immediately" - Package: PODCAST_APP Output Variables: - Title: "title" - Message: "message" |
Write file | If podcast notification is available, write podcast/episode names to podcast_voice_notes.md file in obsidian vault |
Input Arguments: - Content: "\n\nNote from Podcast: \n" <br>++ title ++ "\n" ++ message<br> File: <PATH_TO>/podcast_voice_notes.md" - Set "Append to file" to true |
Create widget for the flow:
- Create widget for the above flow on the home screen.
Overlays app:
- Objective is to get a mic overlay as follows:
- With the mic overlay, I can easily take voice notes without needing to get out of the podcast app.
- Install Overlays - Floating Launcher - Apps on Google Play
- Steps to create the button:
- Go to "Triggers" tab
- Add new trigger: "Foreground Application"
- Select your preferred podcast app
- In "Add Overlay", select the flow widget
- Tap the flow -> Icon -> select the "mic" icon (or anything else)
- Re-position the overlay anywhere in the screen. That will be the default position.
- This will open the mic overlay whenever the podcast app is opened.
Obsidian Template:
- With the above steps, any voice note will be recorded in the
podcast_voice_notes.md
file. - Now, the file itself will be disorganized, as each entry will be concatenated at the end.
- Following templater script can be used to quickly reformat all notes in that file:
- Template (save as podcast_voice_notes.md in the templater templates folder):
# Podcasts:
<% tp.user.podcast_voice_notes(tp.file.content) %>
---
## Raw Notes: %% fold %%
---
- Script (save as podcast_voice_notes.js in the templater scripts folder):
- The script even removes any notes with no information.
function my_function(msg) {
// Split the input string into blocks
const blocks = msg.trim().split('---').filter(block => block.trim() !== '');
const podcasts = {};
// Process each block
blocks.forEach(block => {
const lines = block.trim().split('\n').map(line => line.trim()).filter(line => line !== '');
const phrase = lines[1];
const podcastName = lines[3];
const podcastEpisode = lines[4];
// Filter out empty phrases and specific phrases
if (!phrase || phrase.toLowerCase() === 'hello' || phrase === 'Note from Podcast:') {
return;
}
if (!podcasts[podcastName]) {
podcasts[podcastName] = {};
}
if (!podcasts[podcastName][podcastEpisode]) {
podcasts[podcastName][podcastEpisode] = [];
}
podcasts[podcastName][podcastEpisode].push(`- ${phrase}`);
});
// Format the output
let output = '';
for (const podcastName in podcasts) {
output += `## ${podcastName}: %% fold %%\n`;
for (const episode in podcasts[podcastName]) {
output += `### ${episode}:\n`;
output += podcasts[podcastName][episode].join('\n') + '\n';
}
}
return output;
}
module.exports = my_function;
Conclusion:
- Following above steps, voice notes can easily be recorded from any podcast app.
Sample Output:
Raw notes:
5/25/24 11:04 PM
Note from Podcast:
Medical Murders
Jack the Ripper Pt. 1
5/25/24 8:46 PM
Jack the Ripper committed a lot of murders in Whitechapel London in 1888
Note from Podcast:
Medical Murders
Jack the Ripper Pt. 1
5/20/24 7:32 PM
early humans started off in Africa it's called Out Of Africa Theory
Note from Podcast:
Philosophize This!
Episode #001 ... Presocratic Philosophy - Ionian
5/20/24 7:32 PM
then they started slowly moving to the Fertile Crescent.
Note from Podcast:
Philosophize This!
Episode #001 ... Presocratic Philosophy - Ionian
Template Output:
# Podcasts:
## Medical Murders: %% fold %%
### Jack the Ripper Pt. 1:
- Jack the Ripper committed a lot of murders in Whitechapel London in 1888
## Philosophize This!: %% fold %%
### Episode #001 ... Presocratic Philosophy - Ionian:
- early humans started off in Africa it's called Out Of Africa Theory
- then they started slowly moving to the Fertile Crescent.