Skip to content

Making this work on Ubuntu #43

Description

@DiagonalArg

I had to remove import winsound from gui.py and kokoro_engine.py. Then, with the follow search/replace, it works:

python3 -c "
with open('gui.py', 'r') as f: text = f.read()
text = text.replace('winsound.PlaySound(tmp_audio_path, winsound.SND_FILENAME | winsound.SND_ASYNC)', 'import os; os.system(f\"aplay {tmp_audio_path} &\")')
text = text.replace('winsound.PlaySound(tmp_path, winsound.SND_FILENAME | winsound.SND_ASYNC)', 'import os; os.system(f\"aplay {tmp_path} &\")')
with open('gui.py', 'w') as f: f.write(text)
"
python3 -c "
with open('kokoro_engine.py', 'r') as f: text = f.read()
text = text.replace('winsound.PlaySound(None, winsound.SND_PURGE)', 'import os; os.system(\"pkill aplay\")')
text = text.replace(\"await asyncio.to_thread(winsound.PlaySound, item['path'], winsound.SND_FILENAME)\", \"import os; os.system(f\\\"aplay {item['path']}\\\")\")
with open('kokoro_engine.py', 'w') as f: f.write(text)
"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions