Python 2.7 and Pyo, Server must be booted before creating any audio project

938 Views Asked by At

I am using Pyo (http://ajaxsoundstudio.com/software/pyo/) in Python 2.7.14 and I an trying to play an audio file with this code

from pyo import *
s = Server()
s.boot()
s.start()
sf  = SfPlayer("C:\Users\name\Downloads\audio.mp3", speed=1, loop=True).out()

but I get this message:

Traceback (most recent call last):
  File "C:\Python27\pyotest.py", line 5, in <module>
    sf  = SfPlayer("C:\Users\name\Downloads\audio.mp3", speed=1, loop=True).out()
  File "C:\Python27\lib\site-packages\pyolib\players.py", line 98, in __init__
    PyoObject.__init__(self, mul, add)
  File "C:\Python27\lib\site-packages\pyolib\_core.py", line 967, in __init__
    PyoObjectBase.__init__(self)
  File "C:\Python27\lib\site-packages\pyolib\_core.py", line 809, in __init__
    raise PyoServerStateException("The Server must be booted before "
PyoServerStateException: The Server must be booted before creating any audio object.
1

There are 1 best solutions below

0
Olfred On

I had the same error once (on Windows). Started the E-Pyo Editor that comes with installing Pyo. After that it worked fine.

If that doesn't help you might want to set the server options and the output device manually.

Get the ID of the desired output device with

pa_list_devices()

If you found your ID you can set it with this command (change the 0 to your device ID) and then boot the server:

s.setOutputDevice(0)
s.boot()