From Insomnia to Innovation: Building SleepScape

This might happen with a lot of people – feeling insomniac at night, taking almost an hour to simply fall asleep. To ensure that I do sleep – I use apps like Calm, Headspace, and often YouTube to listen to something which might simply get my mind to calm down and not think about anything else. I know it’s hard but then again, the goal is to Sleep!

While the Apps do work, often, they don’t fall into the exact requirement that I have. Thus, the developer in me started brainstorming. I started thinking of building a mobile app using React Native for Android and iOS. It took me around a weekend to develop the interface. For APIs, I decided to make use of Cloudflare Workers with KV connected with S3-Compatible DigitalOcean Spaces. Obviously, I will be using Google’s Firebase for lots of things, especially, Auth.

At the moment, the important thing, that I have been trying to achieve is generating a human-like speech using various LLMs and TTS engines. I have tried ElevenLabs but it becomes too costly in the long run in generating these sleep stories. ChatGPT helped me figure out the comparisons between some of the engines and based on the requirements, I tried some of the other engines like Coqui TTS, Bark, and Tortoise TTS. Just to let you know, the configuration of my PC is i7-12700K, 64GB DDR5 RAM, 3TB SSD, and most importantly Nvidia RTX 3060ti (which can run these TTS engines easily).

I thought, I will first come up with an easy task of setting up and finetuning the code to get a better audio and then probably, if needed, I will rent a faster GPU like RTX 4090 from vast.ai or Azure Spot Virtual Machines to run these at a faster level.

Imagine…
You find yourself standing barefoot upon soft, sun-warmed sand…
Gazing out at an endless ocean, stretching toward the horizon…

A sample generated, which felt it’s good at least. Now need to finetune and keep testing to ensure that we are able to generate a set of voice configurations that could be used to generate the audio of the story.