J_yang
J_yang

Reputation: 2812

PYO, How are route audio to sound card device

I am using pyo to play some audio on my code. The set up is as follow:

from pyo import *
import time
s = Server(sr=44100, nchnls=2, buffersize=1024, duplex=0).boot()
s.start()

This will results in audio being played on the default device (internal speaker). However, when I connected the external soundcard. The audio still plays from the internal speakers. So I wonder how to set it up.

I checkex the API, it said to use setInOutDevice(x) : Set both input and output devices. See pa_list_devices(). But I dont know how to use pa_list_devices() to output the list of audio devices.

Thanks for your help.

Upvotes: 2

Views: 1261

Answers (1)

Fabien
Fabien

Reputation: 21

From the python interpreter:

>>> pa_list_devices()

will print a list of devices. Find the number for the device you want, and use the setInOutDevice(number) BEFORE booting the server, like this:

s = Server()
s.setInOutDevice(number)
s.boot()

Upvotes: 2

Related Questions