Skip to content

Commit

Permalink
Append search params instead of overwriting (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
JstnMcBrd committed Feb 13, 2024
1 parent e67684f commit ed59a3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "1.0.1",
"description": "API wrapper for the Dectalk TTS system",
"keywords": [
"dectalk",
"tts",
"api",
"text-to-speech",
"wav"
"tts",
"wav",
"dectalk"
],
"homepage": "https://github.com/JstnMcBrd/dectalk-tts",
"bugs": "https://github.com/JstnMcBrd/dectalk-tts/issues",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Buffer } from 'node:buffer';
import { URL, URLSearchParams } from 'node:url';
import { URL } from 'node:url';

/**
* @param text The text to send to the aeiou Dectalk API
Expand All @@ -16,7 +16,7 @@ export default async function dectalk(text: string): Promise<Buffer> {

// Format request URL
const url = new URL('https://tts.cyzon.us/tts');
url.search = new URLSearchParams({ text }).toString();
url.searchParams.append('text', text);

// Send request
const response = await fetch(url);
Expand Down

0 comments on commit ed59a3f

Please sign in to comment.