Skip to content

Commit

Permalink
Kill existing say process before running
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Jun 9, 2024
1 parent f9b4432 commit b7ea8cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {execa} from 'execa';
import {killRunningSay} from './utils.js';

export type SayOptions = {
voice?: string;
Expand All @@ -12,6 +13,7 @@ export type SayOptions = {
};

export async function say(text: string, options: SayOptions = {}) {
await killRunningSay();
const {voice, rate, audioDevice, quality, inputFile, outputFile, networkSend, channels} = options;
await execa(
'say',
Expand Down

0 comments on commit b7ea8cf

Please sign in to comment.