Migushthe2nd / MsEdgeTTS

A simple Azure Speech Service module that uses the Microsoft Edge Read Aloud API
https://migushthe2nd.github.io/MsEdgeTTS/
MIT License
272 stars 40 forks source link

RIFF_16KHZ_16BIT_MONO_PCM cannot generate WAV format files #10

Closed qingfengmy closed 10 months ago

qingfengmy commented 10 months ago
import {MsEdgeTTS, OUTPUT_FORMAT} from "msedge-tts";

(async () => {
    const tts = new MsEdgeTTS();
    await tts.setMetadata("en-US-AriaNeural", OUTPUT_FORMAT.RIFF_16KHZ_16BIT_MONO_PCM);
    const filePath = await tts.toFile("./wav.wav", "Hi, how are you?");  
})();

The format RIFF_16KHZ_16BIT_MONO_PCM does not produce WAV files

Migushthe2nd commented 10 months ago

It seems the edge api is limited to three audio formats. See the updated https://github.com/Migushthe2nd/MsEdgeTTS/blob/f83089b4ac2ccebab78e64702c1d062e33443e0e/src/OUTPUT_FORMAT.ts for the formats. I've published a new version.