Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

704 B
Raw Blame
import {
  VOICE_OFFSCREEN_TARGET,
  VoiceMessage,
  type VoiceStepMark,
  type VoiceStopRequest,
  type VoiceStopResponse,
  type VoiceTranscriptionSettings,
  voiceMessage,
} from '../voice/voice-message';
import { answered } from './answered';

export function stopVoiceCapture(
  guideId: string,
  steps: VoiceStepMark[],
  settings: VoiceTranscriptionSettings,
): Promise<VoiceStopResponse> {
  return answered<VoiceStopResponse>(
    voiceMessage<VoiceStopRequest>({
      type: VoiceMessage.VOICE_STOP,
      target: VOICE_OFFSCREEN_TARGET,
      guideId,
      steps,
      settings,
    }),
    { ok: false, reason: 'stream-ended', error: 'The microphone host is no longer available' },
  );
}