@andresaya/edge-tts 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,9 +67,9 @@ await tts.synthesize("Hello, world!", 'en-US-AriaNeural', {
67
67
  });
68
68
 
69
69
  // Export synthesized audio in different formats
70
- const base64Audio = tts.toBase64(); // Get audio as base64
70
+ tts.toBase64(); // Get audio as base64
71
71
  await tts.toFile("output.wav"); // Save audio to file
72
- const rawAudio = tts.toRaw(); // Get raw audio stream
72
+ await tts.toRaw(); // Get raw audio buffer
73
73
  ```
74
74
 
75
75
  ## Export Options
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  // @bun
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -1948,11 +1949,12 @@ class EdgeTTS {
1948
1949
  throw new Error("No audio data available to save.");
1949
1950
  }
1950
1951
  }
1951
- async toRaw() {
1952
+ toRaw() {
1952
1953
  if (this.audio_stream.length === 0) {
1953
1954
  throw new Error("No audio data available.");
1954
1955
  }
1955
- return Buffer.concat(this.audio_stream);
1956
+ const audioBuffer = Buffer.concat(this.audio_stream);
1957
+ return audioBuffer.toString("base64");
1956
1958
  }
1957
1959
  toBase64() {
1958
1960
  const audioBuffer = Buffer.concat(this.audio_stream);
@@ -2001,7 +2003,7 @@ var VoiceListCommand = new Command("voice-list").description("Get the list of av
2001
2003
 
2002
2004
  // src/cli/edge-tts.ts
2003
2005
  var program2 = new Command;
2004
- program2.version("1.1.4").addCommand(SynthesizeCommand).addCommand(VoiceListCommand);
2006
+ program2.version("1.1.7").addCommand(SynthesizeCommand).addCommand(VoiceListCommand);
2005
2007
  try {
2006
2008
  program2.parse();
2007
2009
  } catch (error) {
@@ -1948,11 +1948,12 @@ class EdgeTTS {
1948
1948
  throw new Error("No audio data available to save.");
1949
1949
  }
1950
1950
  }
1951
- async toRaw() {
1951
+ toRaw() {
1952
1952
  if (this.audio_stream.length === 0) {
1953
1953
  throw new Error("No audio data available.");
1954
1954
  }
1955
- return Buffer.concat(this.audio_stream);
1955
+ const audioBuffer = Buffer.concat(this.audio_stream);
1956
+ return audioBuffer.toString("base64");
1956
1957
  }
1957
1958
  toBase64() {
1958
1959
  const audioBuffer = Buffer.concat(this.audio_stream);
@@ -1948,11 +1948,12 @@ class EdgeTTS {
1948
1948
  throw new Error("No audio data available to save.");
1949
1949
  }
1950
1950
  }
1951
- async toRaw() {
1951
+ toRaw() {
1952
1952
  if (this.audio_stream.length === 0) {
1953
1953
  throw new Error("No audio data available.");
1954
1954
  }
1955
- return Buffer.concat(this.audio_stream);
1955
+ const audioBuffer = Buffer.concat(this.audio_stream);
1956
+ return audioBuffer.toString("base64");
1956
1957
  }
1957
1958
  toBase64() {
1958
1959
  const audioBuffer = Buffer.concat(this.audio_stream);
package/dist/index.js CHANGED
@@ -122,11 +122,12 @@ class EdgeTTS {
122
122
  throw new Error("No audio data available to save.");
123
123
  }
124
124
  }
125
- async toRaw() {
125
+ toRaw() {
126
126
  if (this.audio_stream.length === 0) {
127
127
  throw new Error("No audio data available.");
128
128
  }
129
- return Buffer.concat(this.audio_stream);
129
+ const audioBuffer = Buffer.concat(this.audio_stream);
130
+ return audioBuffer.toString("base64");
130
131
  }
131
132
  toBase64() {
132
133
  const audioBuffer = Buffer.concat(this.audio_stream);
@@ -122,11 +122,12 @@ class EdgeTTS {
122
122
  throw new Error("No audio data available to save.");
123
123
  }
124
124
  }
125
- async toRaw() {
125
+ toRaw() {
126
126
  if (this.audio_stream.length === 0) {
127
127
  throw new Error("No audio data available.");
128
128
  }
129
- return Buffer.concat(this.audio_stream);
129
+ const audioBuffer = Buffer.concat(this.audio_stream);
130
+ return audioBuffer.toString("base64");
130
131
  }
131
132
  toBase64() {
132
133
  const audioBuffer = Buffer.concat(this.audio_stream);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andresaya/edge-tts",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "module": "dist/index.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",