Cannot find a way to send signal to a specific ouput
See original GitHub issueI have a Lexicon Omega Audio interface. I have written a small program from examples to send a sinewave to the output through MME. This works. I have had a go at selecting an ASIO output and using the channel_selector argument, but no luck. I get invalid number of channels. Is there a way I am missing to be able to pass an argument that says I want outdata to go to a specific output of the device I am using?
import sounddevice as sd
import numpy as np
import scipy.stats as ss
import queue
asio_out = sd.AsioSettings(channel_selectors=[1, 2])
out_q = queue.Queue()
global start_idx
start_idx = 0
def callback(outdata, frames, time, status):
global start_idx
t = (start_idx + np.arange(frames)) / 48000
t = t.reshape(-1, 1)
sine = 0.9 * np.sin(2 * np.pi * 1000 * t)
outdata[:] = sine
out_q.put(sine)
start_idx += frames
with sd.OutputStream(device=24, samplerate=48000, channels=4, blocksize=4096, callback=callback, extra_settings=asio_out):
while True:
pass
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to Write Advanced Signal Handlers in UNIX - Oracle
The first step is to declare a signal handling routine. There are two kinds of signal handling routines: one kind that does not...
Read more >go - How to send an interrupt signal - Stack Overflow
I know how to intercept interrupt signals from the console, by using signal.Notify(interruptChannel, os.Interrupt) , however, I can't find a way ...
Read more >kill() — Send a signal to a process - IBM
You can use either signal() or sigaction() to specify how a signal will be handled when kill() is invoked. A process can use...
Read more >Linux Signals help - Computer Hope
Finding system-specific signals To view the signals used by your operating system, open a terminal and run man signal or man 7 signal....
Read more >signal — Set handlers for asynchronous events ... - Python Docs
A Python signal handler does not get executed inside the low-level (C) signal handler. Instead, the low-level signal handler sets a flag which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess this issue is resolved, right?
Great that you found the solution yourself!
For the “explicit” case you could also write:
outdata[:, :] = data
, which does the same ifoutdata
has 2 channels.In the “one channel” cases, the inner brackets are not necessary, you can write:
outdata[:, 0] = data
, which I think would be more idiomatic.