[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/992/original/ComfyUI_00091_.png?1760458084","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eOverview\u003c/h2\u003e\n\u003cp\u003eThe \u003ca href=\"https://learn.adafruit.com/spell-jam-app-on-fruit-jam/overview\" target=\"_blank\"\u003eSpell Jam\u003c/a\u003e\u0026nbsp;app on the \u003ca href=\"https://www.adafruit.com/product/6200\" target=\"_blank\"\u003eFruit Jam\u003c/a\u003e is a twist on a classic electronic toy. Check out the \u003ca href=\"https://learn.adafruit.com/spell-jam-app-on-fruit-jam/overview\" target=\"_blank\"\u003eSpell Jam learn guide\u003c/a\u003e to learn all about it.\u003c/p\u003e\n\u003cp\u003eBy default, Spell Jam uses the Amazon Polly Text-to-Speech (TTS) service to create audio from the entered text. While Amazon's service can be used for free during a trial period, it does require an AWS account.\u003c/p\u003e\n\u003cp\u003eIf you'd prefer not to create an Amazon AWS account, you can instead run a local TTS server on your home network using open-source models like \u003ca href=\"https://github.com/KittenML/KittenTTS\" target=\"_blank\"\u003eKittenTTS\u003c/a\u003e,\u0026nbsp;\u003ca href=\"https://github.com/nineninesix-ai/kani-tts\" target=\"_blank\"\u003eKani-TTS\u003c/a\u003e or \u003ca title=\"eSpeak\" href=\"https://espeak.sourceforge.net/index.html\" target=\"_blank\"\u003eeSpeak\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThis playground will walk you through the steps required to run a local TTS server on your network and configure Spell Jam on your Fruit Jam to use that server instead of AWS.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n        \u003ch2\u003eInstalling a Text-to-Speech Model\u003c/h2\u003e\n\u003cp\u003eThere are two TTS AI models that the Spell Jam local backend works with:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ca href=\"https://github.com/KittenML/KittenTTS\" target=\"_blank\"\u003eKittenTTS\u003c/a\u003e - lightweight, will run on a Raspberry Pi 4/5\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://github.com/nineninesix-ai/kani-tts\" target=\"_blank\"\u003eKani-TTS\u003c/a\u003e\u0026nbsp; - newer, but may require an Nvidia GPU. (as of 2/2026 Kani no longer works with server.py)\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eLegacy software TTS application:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ca title=\"eSpeak\" href=\"https://espeak.sourceforge.net/\" target=\"_blank\"\u003eeSpeak\u003c/a\u003e - Initially released in 2006, a free and open-source compact speech synthesizer.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cstrong\u003eBefore install any of the TTS systems, create and/or activate a dedicated Python virtual environment.\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003epython3 -m venv venv\u003cbr\u003esource venv/bin/activate\u003c/pre\u003e\n      \n\n\n","metadata":{}},{"element_type":"text","content":"\n        \u003ch3\u003eeSpeak\u003c/h3\u003e\n\u003cp\u003eTo install the eSpeak software type the following commands:\u003c/p\u003e\n\u003cpre\u003esudo apt update\u003cbr\u003esudo apt install espeak\u003cbr\u003e\u003cbr\u003epip install uvicorn scipy fastapi numpy pydantic\u003c/pre\u003e\n\u003ch3\u003eKittenTTS\u003c/h3\u003e\n\u003cp\u003eAs outlined in the\u0026nbsp;\u003ca href=\"https://learn.adafruit.com/speech-synthesis-on-raspberry-pi-with-kittentts/kittentts-setup\" target=\"_blank\"\u003eSpeech Synthesis On Raspberry Pi with KittenTTS\u003c/a\u003e Learn Guide.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cstrong\u003eCreate and activate a virtaul environment\u003c/strong\u003e\u003cstrong\u003e:\u003c/strong\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003emkdir KittenTTS\u003cbr\u003ecd KittenTTS\u003cbr\u003epython3 -m venv venv\n\u003cspan class=\"pl-c1\"\u003esource\u003c/span\u003e venv/bin/activate\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003e\u0026nbsp; \u0026nbsp; \u003c/strong\u003e2. \u003cstrong\u003eInstall KittenTTS with \u003c/strong\u003e\u003cstrong\u003epip:\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003epip install https://github.com/KittenML/KittenTTS/releases/download/\u003cspan class=\"hljs-number\"\u003e0.1\u003c/span\u003e/kittentts-\u003cspan class=\"hljs-number\"\u003e0.1\u003c/span\u003e\u003cspan class=\"hljs-number\"\u003e.0\u003c/span\u003e-py3-none-\u003cspan class=\"hljs-built_in\"\u003eany\u003c/span\u003e.whl\u003c/pre\u003e\n\u003cp\u003e\u003cem\u003eThe installation will take several minutes depending on your internet connection, and whether you are using a Pi 4 or Pi 5.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp; \u0026nbsp; 3. \u003cstrong\u003eInstall additional dependencies\u003c/strong\u003e:\u003c/p\u003e\n\u003cpre\u003epip install uvicorn scipy fastapi numpy pydantic\u003c/pre\u003e\n      ","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch3\u003eKani-TTS\u0026nbsp;\u003c/h3\u003e\n\u003ch3\u003e\u003cstrong\u003eThis model has been updated and these instructions are now out of date!\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eAs described in the \"setup\" instructions from the Kani-TTS\u0026nbsp;\u003ca href=\"https://github.com/nineninesix-ai/kani-tts\" target=\"_blank\"\u003eGitHub project\u0026nbsp;page\u003c/a\u003e.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cstrong\u003eClone the repository\u003c/strong\u003e:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003egit clone \u003cspan class=\"pl-k\"\u003ehttps://github.com/nineninesix-ai/kani-tts\u003c/span\u003e\n\u003cspan class=\"pl-c1\"\u003ecd\u003c/span\u003e kani-tts\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003e\u0026nbsp; \u0026nbsp; \u003c/strong\u003e2. \u003cstrong\u003eCreate and activate a virtual environment:\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003epython3 -m venv venv\n\u003cspan class=\"pl-c1\"\u003esource\u003c/span\u003e venv/bin/activate\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003e\u0026nbsp; \u0026nbsp; \u003c/strong\u003e3. \u003cstrong\u003eInstall dependencies:\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003epip install -r requirements.txt\u003c/pre\u003e\n      \n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eRunning the Local TTS Server\u003c/h2\u003e\n\u003cp\u003eOnce the TTS model has been installed, download the server script (\u003ca href=\"https://github.com/RetiredWizard/Fruit_Jam_Spell_Jam_localTTS/blob/main/server.py\" target=\"_blank\"\u003eserver.py\u003c/a\u003e) from\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003ca href=\"https://github.com/RetiredWizard/Fruit_Jam_Spell_Jam_localTTS\" target=\"_blank\"\u003eRetiredWizard/Fruit_Jam_Spell_Jam_localTTS\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThen activate your virtual environment and start the server.\u003c/p\u003e\n\u003cpre\u003esource venv/bin/activate\npython server.py\u003c/pre\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eYour TTS server will now be running on port 8000.\u003c/p\u003e\n\u003cp\u003eIf you have multiple TTS solutions installed, you can force the server to use one of the three supported options by adding one of the model names (kitten, espeak or kani) on the \u003ccode\u003epython server.py [model]\u003c/code\u003ecommand line.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNOTE:\u0026nbsp;\u003c/strong\u003e\u003cstrong\u003eIf your server is running a local firewall, you may need to add a firewall rule to allow TCP traffic to port 8000 from devices on your local network!!!\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eufw on linux for example:\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003esudo ufw allow from 192.168.0.0/16 to any port 8000 proto tcp\u003c/code\u003e\u003c/p\u003e\n\u003ch2\u003eConfiguring Spell Jam to use the local server\u003c/h2\u003e\n\u003cp\u003eThere are three steps to configuring Spell Jam to use a local TTS server:\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003e1. \u003cstrong\u003eCopy the local TTS file\u003c/strong\u003e\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003eDownload \u003ca href=\"https://github.com/RetiredWizard/Fruit_Jam_Spell_Jam_localTTS/blob/main/tts_local.py\" target=\"_blank\"\u003etts_local.py\u003c/a\u003e from \u003ca href=\"https://github.com/RetiredWizard/Fruit_Jam_Spell_Jam_localTTS\" target=\"_blank\"\u003eRetiredWizard/Fruit_Jam_Spell_Jam_localTTS\u003c/a\u003e and place it in:\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003e\u003ccode\u003eCIRCUITPY/apps/Fruit_Jam_Spell_jam\u003c/code\u003e\u0026nbsp;on your Fruit Jam\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003e2. \u003cstrong\u003eEdit the Spell Jam application code\u003c/strong\u003e\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003eOpen \u003ccode\u003eCIRCUITPY/apps/Fruit_Jam_Spell_Jam/code.py\u003c/code\u003e,\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003e\u0026nbsp;comment out the AWS line and uncomment the local TTS line:\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"# from tts_aws import WordFetcherTTS\nfrom tts_local import WordFetcherTTS","metadata":{"language":"python","linenums":false,"filename":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp style=\"padding-left: 40px;\"\u003e3. \u003cspan class=\"blob-code-inner blob-code-marker \"\u003e\u003cspan class=\"pl-k\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cstrong\u003eUpdate the configuration file\u003c/strong\u003e\u003c/p\u003e\n\u003cp style=\"padding-left: 40px;\"\u003eEdit \u003ccode\u003elauncher.conf.json\u003c/code\u003e on your Fruit Jam to include the TTS server endpoint:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"{\n    \"spell_jam\": {\n        \"tts_server_endpoint\": \"http://raspberrypi.local:8000\",\n    },\n}","metadata":{"language":"auto","linenums":false,"filename":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eReplace \u003ccode\u003eraspberrypi.local\u003c/code\u003e with your actual hostname or IP address running server.py.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eNow that your Fruit Jam is talking to you, a fun word to try is \u003cstrong\u003esupercalifragilisticexpialidocious \u003c/strong\u003eor \u003cstrong\u003eantidisestablishmentarianism\u003c/strong\u003e.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}}]