homeros_demo / __test.py
papayaga's picture
voice generation and first story working
49a7070
raw
history blame
1.76 kB
from dotenv import load_dotenv
load_dotenv()
from adaptors.db import get_story, get_all_stories
from pprint import pprint
import json
from loguru import logger
from adaptors.voice import say_new
def all_s():
for s in get_all_stories():
pprint(s.to_dict())
def say(text):
pprint(text)
return say_new(text)
long_text = '''
In a distant and rarely trodden corner of Middle Earth, there
resided an unlikely hero, known to the local forest critters by the '
rather unusual name, Slippersnail. Unlike the courageous Hobbits or '
the formidable Elves, Slippersnail was of a forgotten forest folk, '
a tiny creature, small as a sparrow with an oversized leaf as an '
umbrella and a snail shell for his home. You could hardly tell if
he was a gnome, a brownie or something else, for his kind was
scarcely remembered, even in the oldest songs of the Elves.
Slippersnail, barely tall enough to poke his head above the
bracken, lived an unassuming life, busily brewing his famous
dandelion tea and tending to his miniature garden filled with
colorful nocturnal glow-flowers. One morning, as Slippersnail was
pruning his glow-flowers, he found a peculiar golden leaf which
glittered so brightly it could outshine the glow-flowers by far.
Soon he discovered that the leaf had a magical property: it could
create light as bright as a day where the darkness had fallen.
The news of the magical leaf reached the ears of the Dark Lord in
the East. Coveting the leaf to manipulate it for his evil motives,
Sauron dispatched a band of his malevolent minions in search of
Slippersnail and his leaf.
Unaware of the danger, Slippersnail saw the shadow creeping over
his garden now. But, what do you think should our little hero do
next?
'''
say(long_text)