Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output through JACK on Linux? #56

Open
albedozero opened this issue Jul 22, 2021 · 0 comments
Open

Output through JACK on Linux? #56

albedozero opened this issue Jul 22, 2021 · 0 comments

Comments

@albedozero
Copy link

albedozero commented Jul 22, 2021

I'd like to be able to output sound clips using simpleaudio via JACK on a Raspberry Pi while another application is also producing sound output through JACK (using ALSA backend) - specifically FluidSynth. Is there an existing way to tell simpleaudio to do this? Here's my example code:

#!/usr/bin/env python3

import simpleaudio as sa

wave_obj = sa.WaveObject.from_wave_file("test.wav")
play_obj = wave_obj.play()
play_obj.wait_done()

The result is

Traceback (most recent call last):
  File "./test.py", line 6, in <module>
    play_obj = wave_obj.play()
  File "/usr/local/lib/python3.7/dist-packages/simpleaudio/shiny.py", line 20, in play
    self.bytes_per_sample, self.sample_rate)
  File "/usr/local/lib/python3.7/dist-packages/simpleaudio/shiny.py", line 61, in play_buffer
    sample_rate)
_simpleaudio.SimpleaudioError: Error opening PCM device. -- CODE: -16 -- MSG: Device or resource busy

Which makes sense, since the sound card is being used by JACK - but is there a way to get simpleaudio to appear as a JACK client I can connect to the system outputs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant