How to Automatically Identify Speakers in Audio Using NotebookLM

Source: Screenshot by the Writer

As a freelancer—whether you're a podcast editor, content creator, or meeting note-taker—identifying speakers in an audio file can save you hours of manual transcription and formatting. Here's a streamlined method using NotebookLM and a few simple tools to automate speaker recognition in your workflow.

1. Set up an audio file on NotebookLM

If you don't know how to do this, read this article.


2. Use the following prompt

Paste this prompt into the Notebook and run it:

Generate a transcript that recognizes different speakers.

3. Save the generated transcript in a text file.

Copy the transcript and save it as a .txt file on your computer.


4. Upload to Gemini (Optional)

Visit Gemini and click the "+" button to upload the text file.

Source: Screenshot by the Writer


5. Format the transcript (Optional)

Run this prompt to format the transcript.

Format the text based on this format below:
    
"
Speaker 1: (statement)

Speaker 2: (statement)
"

6. For Developers: Format with JavaScript

Want cleaner formatting? Use this JavaScript snippet in your browser’s Developer Console to add line breaks between speaker changes.

const text = `(transcript)`;

function addNewlineForCharacter(originalText) {
  const regex1 = new RegExp("\\bSpeaker 1", "g");
  const regex2 = new RegExp("\\bSpeaker 2", "g");

  return originalText
    .replace(regex1, "\n\nSpeaker 1")
    .replace(regex2, "\n\nSpeaker 2");
}

const textWithNewline = addNewlineForCharacter(text);
console.log(textWithNewline);

Use cases for freelancers

  • Podcast Production: Focus on editing and storytelling instead of transcription
  • Meeting Minutes: Identify who said what for clearer, actionable notes
  • YouTube Subtitling: Quickly assign quotes to different voices for accurate captions

By combining NotebookLM, Gemini, and simple JavaScript automation, you can transform how you handle audio content—saving time and delivering polished results for your clients or audience.

Comments

Popular posts from this blog

How to set up a new NotebookLM in NotebookLM