Stereo Recording Problem

Hi,
We’re having this weird problem where we only get one channel of audio when we try to record speech in stereo via PsychoPy. If we use Windows Voice Recorder with the same input device we get two channels of audio. But when we try the exact same thing in PsychoPy only one channel contains data, the second channel (when viewed in Matlab) is just zeros.

Any thoughts on how to fix this would be greatly appreciated!

We’re running PsychoPy v1.84.1 on Windows 10.

Thanks
Dan

I don’t really know the answer - I don’t think I have a mic that would support proper stereo input but, from a quick look at the microphone code it seems that this should be possible.

Do you have a stereo mic or is this a normal mic and you’re just wanting your mono sound to appear in both output channels? Are you doing this in code or builder? What settings are you using (is stereo set to True or False) or did you try both ways?

Hi Jon, thanks for the response!

The input device is a USB audio interface (MOTU audio express) that outputs two channels. (It’s an altered feedback experiment, so one channel contains what subjects produced into a microphone and the other channel is a voice alteration played back to them in near real time via headphones.) I’ve set the USB device to be the primary input device in Windows and I can record both channels just fine via a Windows Voice recording in stereo. If, in PsychoPy, I drop the microphone icon into builder and click “stereo” I get a wav file with two channels but the second channel is just zeros. The first channel has data - it’s identical to the first channel recorded with Voice Recorder, so that channel is fine. So it’s like it sets up the structure to record two channels but then only actually fills the first for some reason. It’s very weird … If you have some code handy to trigger the microphone I could try that.

Thanks in advance!

Sorry, I don’t know how to help you more than that. @jeremygray might know more.

I’m wondering if pyo thinks your input is only single channel for some reason. From the Coder shell, try this to see:

>>> import pyo
>>> pyo.pa_get_input_max_channels(0)
2

The 0 here is the default input device for me – you’ll need that to correspond to the proper device for your situation. You can get your default input like this: pyo.pa_get_default_input() – of course, the default might not be the one you actually want.

The 2 output above that I get means that I have stereo input (microphone). If you get a 0 it probably means you selected an output device, not input. If you get a 1, it means that pyo thinks your input device is mono, not stereo.

EDIT:
Also, its possible that pyo is using a built-in default device (which happens to be mono), and not using your stereo mic.

>>> pyo.pa_get_devices_infos()
({0: {'host api index': 0, 'latency': 0.001995464786887169, 'default sr': 44100, 'name': 'Built-in Microph'}}, {1: {'host api index': 0, 'latency': 0.006553288083523512, 'default sr': 44100, 'name': 'Built-in Output'}})

should return info about the devices it can see. I get device 0 as the built-in microphone, and device 1 as the built-in output.

Thanks so much Jeremy.

I get 2 when I run pyo.pa_get_input_max_channels. But when I run get_devices_infos I get the the mess pasted below. I want MOTU Mic/Instrument 1-2, which does not appear to be the default (0). Is there a way to specify the input device in PsychoPy?

Thanks in advance!

({0: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘Microsoft Sound Mapper - Input’}, 1: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Mic/Instrument 1-2 (MOTU A’}, 2: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Mix 1 Return 1-2 (MOTU Aud’}, 3: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘Microphone (Realtek High Defini’}, 4: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wav’}, 5: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wav’}, 32: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 48000, ‘name’: ‘Microphone (Realtek High Definition Audio)’}, 12: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘Primary Sound Capture Driver’}, 13: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Mic/Instrument 1-2 (MOTU Audio Wave for 64 bit)’}, 14: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Mix 1 Return 1-2 (MOTU Audio Wave for 64 bit)’}, 15: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘Microphone (Realtek High Definition Audio)’}, 16: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wave for 64 bit)’}, 17: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wave for 64 bit)’}, 34: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wave for 64 bit)’}, 24: {‘host api index’: 2, ‘latency’: 0.01160997711122036, ‘default sr’: 44100, ‘name’: ‘MOTU Audio ASIO’}, 33: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wave for 64 bit)’}, 30: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Mic/Instrument 1-2 (MOTU Audio Wave for 64 bit)’}, 31: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Mix 1 Return 1-2 (MOTU Audio Wave for 64 bit)’}}, {6: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘Microsoft Sound Mapper - Output’}, 7: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: 'Speakers / Headphones (Realtek '}, 8: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wav’}, 9: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Main Out 1-2 (MOTU Audio W’}, 10: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wav’}, 11: {‘host api index’: 0, ‘latency’: 0.09000000357627869, ‘default sr’: 44100, ‘name’: ‘MOTU Phones 1-2 (MOTU Audio Wav’}, 18: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘Primary Sound Driver’}, 19: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘Speakers / Headphones (Realtek High Definition Audio)’}, 20: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wave for 64 bit)’}, 21: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Main Out 1-2 (MOTU Audio Wave for 64 bit)’}, 22: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wave for 64 bit)’}, 23: {‘host api index’: 1, ‘latency’: 0.11999999731779099, ‘default sr’: 44100, ‘name’: ‘MOTU Phones 1-2 (MOTU Audio Wave for 64 bit)’}, 24: {‘host api index’: 2, ‘latency’: 0.01160997711122036, ‘default sr’: 44100, ‘name’: ‘MOTU Audio ASIO’}, 25: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 48000, ‘name’: ‘Speakers / Headphones (Realtek High Definition Audio)’}, 26: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Analog 1-2 (MOTU Audio Wave for 64 bit)’}, 27: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Main Out 1-2 (MOTU Audio Wave for 64 bit)’}, 28: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU S/PDIF 1-2 (MOTU Audio Wave for 64 bit)’}, 29: {‘host api index’: 3, ‘latency’: 0.003000000026077032, ‘default sr’: 44100, ‘name’: ‘MOTU Phones 1-2 (MOTU Audio Wave for 64 bit)’}})

Hi Jeremy,

With the holidays out of the way I was wondering if you had any thoughts on my last message.

Best
Dan