Skip to content

docs: clarify toFile() output files and where prosody options go - #40

Merged
Migushthe2nd merged 2 commits into
Migushthe2nd:mainfrom
b84330808:docs/tofile-behavior
Oct 25, 2026
Merged

Migushthe2nd merged 2 commits into
Migushthe2nd:mainfrom
b84330808:docs/tofile-behavior

Conversation

@b84330808

@b84330808 b84330808 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

README-only change. I use msedge-tts in a video pipeline and ran into these while building it:

  • Metadata example calls toFile() without the directory. tts.toFile("Hi, how are you?") passes the text as dirPath and leaves input undefined. It's now tts.toFile("./tmpfolder", "Hi, how are you?"), matching the "Write to file" example.
  • toFile() output names aren't documented. _rawSSMLRequestToFile() always writes audio.<extension> (and metadata.json when boundaries are on) into dirPath and doesn't create the directory, so a missing directory rejects with ENOENT and repeated calls overwrite each other. Added a short note and pointed to toStream() for custom file names.
  • Prosody passed to setMetadata() is silently ignored. From plain JS it's easy to pass {rate: ...} as the third argument of setMetadata(). It gets merged into MetadataOptions and never reaches the SSML, so every request renders at the default speed. Added one sentence saying prosody goes to toStream()/toFile().

No code changes. Happy to reword or drop any part.

I drafted this with an AI assistant (Claude Code) and checked each statement against src/MsEdgeTTS.ts and src/Prosody.ts on main before submitting.

b84330808 and others added 2 commits October 15, 2026 13:13
- Fix the metadata example, which called toFile() without the directory argument.
- Note that toFile() needs an existing directory and always writes
  audio.<extension> (and metadata.json), overwriting earlier output.
- Note that rate/pitch/volume belong in toStream()/toFile() options;
  setMetadata() ignores them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Migushthe2nd
Migushthe2nd merged commit 4042e71 into Migushthe2nd:main Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants