P
P
Ping Wins2019-02-24 10:06:19
Python
Ping Wins, 2019-02-24 10:06:19

How to play a Python sound?

I have this piece of code

import os

def talk(words):
    print(words)
    os.system (words)

talk ("Это бот")

Gives an error on startupsh: 1: Это: not found

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pasechnik Kuzmich, 2019-02-24
@Hivemaster

The os.system() function is used to run programs. You probably don't have any executable files named "This" on your system.

D
de-dup-i-dipi, 2019-02-24
@de-dup-i-dipi

You will need a program such as say, festival, espeak and the like. Then you need to call like
os.system(say words)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question