Playing and recording sound

I’m thinking of getting a Q403 to test some prototype scientific equipment. I will want to do many of the same tests that are needed for audio equipment, but also some extras. In particular I will need to:

  • Send two signals to the outputs with precisely controlled amplitude and relative phase
  • Record the response from the thing I’m testing
  • Analyse that response using external software, probably a python script
  • Use the results to calculate a new signal to send to the outputs
  • Go back to step 1 with the new signal

I will need to do that in a fully automatic way, no user interaction, no clicks, preferably ten times a second. One way I could do that is if I could set up the QA403 so that it appears as a soundcard in windows. Another way would be if there is a software API that I can use. A third way would be if I can write a wav file, then call the QA403 software with a command line argument to play that WAV file and record the response as another WAV file, and read that wav file back into my script.

I can’t work out whether this kind of thing would be supported, and the QA403 page mentions a proprietary communications protocol, which makes me think that it may not be. Does anyone know if this will work, or am I barking up the wrong tree?

I’ve now found some forum posts I missed before. Looks like the bare metal or REST interfaces are what I’m looking for. Are these 1) available on the QA403? 2) documented anywhere?

Hi @JackB,

The first thread below might be a good starting point. I have a lot of changes to the PyQa40x repo coming that will hopefully get pushed up today or this weekend. The aim for me is an environment for quick prototyping of algorithms using the QA403 and python. I’m not a python guy, but with llm can make it do what I need.

The second link is the PyQa40x repo.

If you can deal with discrete communication events (the bullets you outline suggest you can), then what is in place currently should work. Just define and output (DAC) and input (ADC) buffer, and call send_receive() and that will handle everything for you. When that’s done, you can process the input ADC data. See the readme at the PyQa40x repo.

The send_receive() will give you a consistent timing relationship between the ADC and DAC, which is often very helpful when first trying algorithms.

That looks like just the thing, thanks. We’ll go ahead and order