Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

783 B
Raw Blame
import { AUDIO_SPEAKER } from './audioUpload'
import { FOLDER_COLORS } from './folderAppearance'

export const SPEAKER_COLORS = Object.keys(FOLDER_COLORS).filter(color => color !== 'default')

/** Append newly named speakers without renumbering names already shown. */
export function speakerOrder(previous: readonly string[], names: readonly (string | null)[]): string[] {
  return [...new Set([...previous, ...names.filter((name): name is string => !!name?.trim() && name !== AUDIO_SPEAKER)])]
}

export function speakerColor(track: string, name: string | null | undefined, order: readonly string[]): number | undefined {
  const index = track === 'them' && name && name !== AUDIO_SPEAKER ? order.indexOf(name) : -1
  return index < 0 ? undefined : index % SPEAKER_COLORS.length
}