Skip to content

Samarthpatki/StoryLoomTV

Repository files navigation

StoryLoomTV

Your voice. Their story.

Kotlin Compose TV Gemini AI Android TV


What Is This?

StoryLoomTV is an AI-powered voice-driven interactive narrative experience built exclusively for Android TV.

Most story apps give you buttons to press. StoryLoomTV gives you a voice.

Pick Horror or Mystery. Name your hero. Then speak directly to the AI characters — they remember what you said, react to your fear, reward your bravery and punish your silence. Gemini 1.5 Flash generates every single chapter in real time, shaped around your actual words — not pre-written branches, not keyword matching, not dialogue trees.

The horror genre knows when you are scared. The mystery genre knows when you are clever. Say nothing when asked — the story treats it as fear. Say something brave — the next chapter gets darker. Say something clever — the story rewards you for it.

Every playthrough is completely unique because every response you give is completely unique. No two stories are ever the same.


How It Works

Pick Horror or Mystery
        ↓
Enter your hero name and story length
Short (5 chapters) / Medium (10) / Epic (20)
        ↓
Gemini AI forges your opening chapter
        ↓
Android TTS narrates the story aloud
Narrator, NPC and villain each have
a distinct voice, pitch and speed
        ↓
Story pauses — an NPC character speaks directly to you
"I've seen that look before. Tell me what you're afraid of."
        ↓
Microphone activates — you have 5 seconds
Speak naturally — anything you say is valid
        ↓
Your response is sent to Gemini with full story context:
genre, hero name, last 3 chapters, what you just said
        ↓
Gemini writes the next chapter specifically
around what you told it
        ↓
New scene illustration loads with crossfade
Mood-matched ambient audio shifts
Story continues — darker, deeper, more personal
        ↓
Repeat until The End

Your silence = the story treats it as fear Your bravery = the next chapter gets harder Your cleverness = the story rewards it Your exact words shape every chapter

No two playthroughs are ever the same because no two conversations are ever the same.

Screenshots

Home Screen

Genre Selection

Story Forging

Game Screen

Game Screen 2

Story End


Tech Stack

UI Jetpack Compose for TV — zero XML
Architecture MVVM + Clean Architecture + Hilt
AI Gemini 1.5 Flash — structured JSON output
Voice Input Android SpeechRecognizer — free on-device
Voice Output Android TTS — narrator + character voices
Database Room DB — story and chapter persistence
Audio MediaPlayer — mood-matched ambient sounds

Setup

git clone https://github.com/yourusername/storyloomtv.git

Add your Gemini API key to local.properties:

GEMINI_API_KEY=your_key_here

Get a free key at aistudio.google.com — 1500 requests/day, no credit card needed.

Run on an Android TV emulator:

Android Studio
→ Tools → Device Manager
→ Create Virtual Device
→ Category: TV → Android TV 1080p
→ API 33 → Run

Download

⬇️ Download Latest APK

Requires Android 8.0+ — Android TV only


Built with ❤️ by Samarth

⭐ Star this repo if you found it useful

About

Android TV application/game with dynamic choice based AI story

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages