# Playing and recording sound

**URL:** https://forum.quantasylum.com/t/playing-and-recording-sound/1496
**Category:** QA40x
**Created:** [July 26, 2024, 10:09am UTC](https://forum.quantasylum.com/t/playing-and-recording-sound/1496 "2024-07-26T10:09:50Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![matt](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@matt](https://forum.quantasylum.com/u/matt)
#### Post date: [July 26, 2024, 4:04pm UTC](https://forum.quantasylum.com/t/playing-and-recording-sound/1496/3 "2024-07-26T16:04:55Z")

</div>

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.

> [@Python and QA40x](https://forum.quantasylum.com/t/python-and-qa40x/1464/6):
>
> Here’s a standalone program for looking at energy decay in a room. There are just two calls to the QA40x Python analyzer code: The init() and the sendreceive() for getting the calibrated time-domain data in and out of the QA403. The rest is handled in the code below. Much of the code below doesn’t care about the absolute calibration, except for the instantaneous RMS estimate. I used an SM58 in the home office, and should have used the Earthworks M23R. But it was at work. I used GPT a lot for th…

> **[GitHub - QuantAsylum/PyQa40x: Python library for bare-metal interface to QA40x...](https://github.com/QuantAsylum/PyQa40x)**
>
> Python library for bare-metal interface to QA40x hardware (including calibration)

> [@QA40x\_BareMetal](https://forum.quantasylum.com/t/qa40x-baremetal/769/2):
>
> Very nice, thank you for the example code. I’d like to see an audio driver (like getting the ASIO QA401 driver running for current hardware). This could be a start. The commands are hard-coded, no definition file? Some must be missing. How is the sample rate set, how to use the front panel I2S, how to read power stats, etc? There are 6 endpoints? So far, got the relays clicking in Python, with this piece of code: #!/usr/bin/env python3 import time # just for test import struct import libusb\_…

---

_[View the full topic](https://forum.quantasylum.com/t/playing-and-recording-sound/1496)._
