ANY-maze Help > I/O devices supported by ANY-maze > Other I/O devices supported by ANY-maze > Using soundcards as I/O audio devices

Using soundcards as I/O audio devices

Introduction

ANY-maze can directly control your computer's soundcards, by treating them as I/O devices. The left and right channels of the soundcard are then treated as separate speaker ports, thus giving you two entirely independent sound sources for each soundcard that is installed.

Both speaker ports on a soundcard, or even the speakers from multiple soundcards, can be used within a single apparatus, or (if you are performing an experiment with multiple apparatus), as separate ports for different apparatus.

For more details, see:

 Setting up soundcards for use in ANY-maze 
 Using multiple soundcards for different apparatus 
 Sounds that ANY-maze can play 
 Playing white noise  

Setting up soundcards for use in ANY-maze

Before you can use a soundcard in ANY-maze, you must enable it using the I/O page. Use the Set up devices button in the ribbon bar to show you a list of all the available devices connected to your computer, including soundcards - here you can choose to enable the ones you need.

Note that because ANY-maze uses each channel of the soundcard as an entirely independent speaker port, only soundcards with independent volume control on each channel are listed. However, this should cover most, if not all, modern soundcards.

Enabling a soundcard is as simple as selecting it in the list of devices, then choosing the Enable this soundcard for use in ANY-maze option from the drop-down list under the list of devices. Note that you can also use this list to select which soundcard will play white noise using the Play noise button on the I/O page - see below for further details.

Soundcards, particularly those built into a computer, can have fairly long-winded names and so you'll probably want to give them names that are more meaningful to you. This is particularly helpful if you have multiple soundcards of the same type connected - see below. You can use the Rename this device button on the I/O page's ribbon bar to give the soundcard a 'friendly' name, which is then used throughout the rest of ANY-maze to refer to this soundcard.

You can also use the I/O page to test your soundcards. This may be particularly useful if you have multiple similar USB soundcards attached to your computer, to see which of the soundcards maps to those that are listed in the ANY-maze software.

Once you've enabled any soundcards that you want to use, you can then use them in any protocol where the Protocol mode is set up to use I/O.

Using multiple soundcards for different apparatus

If you're running tests in multiple apparatus simultaneously, you can use a number of different soundcards attached to the ANY-maze computer to generate audio separately for each of the apparatus.

You can purchase small external USB soundcards, with a headphone and microphone port, from under $10. Each of these soundcards will give you two channels (or 'speaker ports' in ANY-maze) via its headphone port. So, for example, if you're running four experiments at once, and you need a speaker in each apparatus, you could attach two USB soundcards to your computer and use them as follows:

  

  

Figure 1. Using two soundcards to control the sound on four apparatus. This involves setting up each soundcard as an I/O device, then using the channels of the soundcards as speaker ports.

Warning: If you're using a number of identical soundcards to generate audio for multiple apparatus, then you'll need to be careful about how you plug them into your computer. Each soundcard has a manufacturer-supplied name (often, for cheaper soundcards, they're just called something like 'USB Audio Device'). However, when you plug the same soundcard into different USB ports on your computer, Windows will assign it a slightly different name based on which port it is plugged into - for example, '2- USB Audio Device' or '3- USB Audio Device'. (This naming system seems to be based on the order in which you plug the soundcard in - the first port you ever plug it into will be given the standard manufacturer's name, and then each subsequent port it's plugged into will assign the next numerical value in order to the name). Once you've plugged the soundcard into each port once, the same 'altered' name will be used every time you plug it into that port.

If you have multiple soundcards of the same type from the same manufacturer, Windows has no way of differentiating between them - it will see each of them as the same soundcard and will therefore give them the same name. So it's very important that if you have multiple soundcards, each of which is connected by cables to speakers for a specific apparatus, that you always plug them into the computer on the same port each time. You could mark the soundcards in some way, or use small stickers to help you remember which soundcard should be plugged into which port.

Note that if two soundcards of the same type, with the same name, are set up to be used in a protocol for different apparatus, but then they are unplugged and plugged back into different ports, then the experiment will still appear to work (since ANY-maze can't know the difference between two identical soundcards) - but the sounds will actually be generated in the wrong apparatus!

Sounds that ANY-maze can play

Soundcards can play any sound that ANY-maze can generate (tones, white noise or sound files), provided that the sound falls within the frequency range of the soundcard. For more details, see the Soundcard speakers topic.

White noise

As described in the Soundcard speakers topic, ANY-maze can play white noise as a consistent background noise and to mask out any other sounds in the lab.

You can set up your soundcard speaker ports to play white noise in one of the following ways:

 1.On the I/O Page, you can use the Play noise button in the ribbon bar to play white noise. By default, this will use the soundcard that Windows has selected as its 'Default device', but you can change this using the Set up devices button in the ribbon bar. Simply select the device you want to use to generate white noise, and select Use this soundcard as the white noise generator on the I/O page from the drop-down list below the list of devices. 
 2.When you set up a speaker using the Speaker settings on the Protocol page, you can select that you want the speaker to play white noise. 
 3.You can use the Make speaker source white noise action in a procedure. 

Normally, when you change a speaker's audio source (between a tone, white noise or a sound file), it stops playing the current source and switches to the new source. However, there may be circumstances in which you want to mix the white noise and another sound. If you've got white noise playing as a background, for example, you might not want to turn this off when you start to play a tone as part of the experiment.

There are a number of ways you could do this:

 1.Use the Play noise button on the I/O Page to play white noise through one of your soundcards. Then, use an action from a procedure to turn on the other sound you want, for example a tone. This will need to use a separate speaker, so you'll need at least two soundcards attached to your computer to achieve this (as mentioned above, you can buy a small USB soundcard for under $10 if you need to). 
 2.Set up your protocol to contain two speakers for each apparatus. Use one of the speakers to play white noise throughout the experiment (you can set this up in the Speaker settings on the Protocol page), and the other to play specific tones during the test (using a procedure action). 

This method can use two separate channels of the same soundcard as two separate audio sources (speaker ports).

 1.If you've only got one speaker, you could wire it up so that both channels of a single soundcard control the same speaker. In this way you could play different sounds on each channel simultaneously, but they'd come out of the same speaker.  

See also:

 An introduction to speakers  
 Setting up a speaker 
 Soundcard configuration 
 Procedures 
 Procedure actions  

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T1285