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:

Implementation:

Create Android Automate App 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:

Overlays app:

Obsidian Template:

# Podcasts:
<% tp.user.podcast_voice_notes(tp.file.content) %>

---
## Raw Notes: %% fold %%
---
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:

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.