News for hackers. Stuff that matters.
Re:Chatterbox TTS by travisvn on Thursday June 12, 2025 @02:50PM (#44261542)
This API wrapper was initially made to support a particular use case where someone's running, say, Open WebUI or AnythingLLM or some other local LLM frontend.

A lot of these frontends have an option for using OpenAI's TTS API, and some of them allow you to specify the URL for that endpoint, allowing for "drop-in replacements" like this project.

So the speech generation endpoint in the API is designed to fill that niche. However, its usage is pretty basic and there are curl statements in the README for testing your setup.

Anyway, to get to your actual question, let me see if I can whip something up. I'll edit this comment with the command if I can swing it.

In the meantime, can I assume your local text files are actual `.txt` files?

Re:Chatterbox TTS by mistersquid on Thursday June 12, 2025 @02:52PM (#44261576)
This is way more of a response than I could have even hoped for. Thank you so much.

To answer your question, yes, my local text files are .txt files.

Re:Chatterbox TTS by travisvn on Thursday June 12, 2025 @03:03PM (#44261738)
Ok, here's a command that works.

I'm new to actually commenting on HN as opposed to just lurking, so I hope this formatting works..

  cat your_file.txt | python3 -c 'import sys, json; print(json.dumps({"input": sys.stdin.read()}))' | curl -X POST http://localhost:5123/v1/audio/speech \
    -H "Content-Type: application/json" \
    -d @- \
    --output speech.wav

Just replace the `your_file.txt` with.. well, you get it.

This'll hopefully handle any potential issues you'd have with quotes or other symbols breaking the JSON input.

Let me know how it goes!

Oh and you might want to change `python3` to `python` depending on your setup.

Re:Chatterbox TTS by mistersquid on Thursday June 12, 2025 @03:13PM (#44261899)
> Just replace the `your_file.txt` with.. well, you get it.

> This'll hopefully handle any potential issues you'd have with quotes or other symbols breaking the JSON input.

> Let me know how it goes!

Wow. I'm humbled and grateful.

I'll update once I'm done with work and back in front of my hone nachine.

Re:Chatterbox TTS by travisvn on Thursday June 12, 2025 @10:04PM (#44265115)
Hey — just pushed a big update that adds an (opt-in) frontend to test the API

For now, there's just a textarea for input (so you'll have to copy the `.txt` contents) — but it's a lot easier than trying to finagle into a `curl` request

Let me know if you have any issues!

Re:Chatterbox TTS by mistersquid on Thursday June 12, 2025 @11:59PM (#44265613)
Absolutely blown away.

I fed it the first page of Gibson's "Neuromancer" and your incantation worked like a charm. Thanks for the shell script pipe mojo.

Some other details:

- 3:01 (3 mins, 1 sec) of generated .wav took 4:28 to process - running on M4 Max with 128GB RAM - Chatterbox TTS inserted a few strange artifacts which sounded like air venting, machine whirring, and vehicles passing. Very odd and, oddly, apropos for cyberpunk - Chatterbox TTS managed to enunciate the dialog _as_ dialog, even going so far as to mimick an Australian accent where the speaker was identified as such.

I am astounded.

Re:Chatterbox TTS by travisvn on Friday June 13, 2025 @04:34PM (#44272002)
An M4 Max with 128GB RAM? drools

What did your `it/s` end up looking like with that setup? MLX is fascinating to me. Apple made a really smart decision with the induction of its M-series.

With regard to the artifacts — this is definitely a known issue with Chatterbox. I'm unsure of where the current investigation on fixing it is at (or what the "tricks" are to avoid this), but it's definitely something that is eery among other things.

I appreciate your feedback through all of this!

Would love to have you on the Discord to keep in touch https://chatterboxtts.com/discord

Re:Chatterbox TTS by mistersquid on Saturday June 14, 2025 @09:34PM (#44279995)
I'll follow up on Discord!

For those following along at home: frontend works (and is quite nice) after updating `vite.config.ts` with a proxy

  server: {
    proxy: {
      // Proxy all API requests to the FastAPI backend
      '/v1': 'http://localhost:4123',
    },
  },