问题
I recently installed Pyo, and I entered Python 3.6 and typed
from pyo import *
s = Server().boot()
s.start()
sf = SfPlayer("C:\Users\myname\Downloads\wot.mp3", speed=1, loop=True).out()
but I get
Traceback (most recent call last): File "C:\Python27\pyo.py", line 1, in from pyo import * File "C:\Python27\pyo.py", line 2, in s = Server().boot() NameError: name 'Server' is not defined
how do I play the audio file?
回答1:
Your own script is called "pyo.py", so when you do from pyo import *
it just looks at your file, not the pyo library. Rename your file.
来源:https://stackoverflow.com/questions/51893964/pyo-in-python-name-server-not-defined