Fastest way to get the content of the two queues transferred to the PC

Status
Not open for further replies.

DIYLAB

Well-known member
Hi,

sorry for the strange question, but what is the fastest way to get the content of the two queues transferred to the PC?
Let's say the queues each contain only one sample block of audio data as an example.
Should I serial transfer the data one after the other or is there a better way?
 

Attachments

  • 2021-03-19_164612.png
    2021-03-19_164612.png
    15.7 KB · Views: 63
Thank you, but I don't quite understand it.
I need the RAW data in 16 bit format, just like the queues provide it - is it possible this way?
How should the evaluation on the PC side look in this case?
 
OK, I thought that you just wanted audio to be available on the PC.

I guess you'll just have to create an output object that writes to "Serial". It's not particularly difficult - just clone another Output object (C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio) and modify it so that it writes the blocks to Serial. output_pwm.cpp is a fairly straightforward one to use. Just delete the DMA code, as that part is already handled for Serial.

You could create a Control object also to manage the USB link, or simply use Serial.begin() in the normal way.

If you want to process RAW data on the PC, then you'll need to write some native code. Python is a natural choice for this: https://forum.pjrc.com/threads/66565-Teensy-3-6-to-Python-Serial-Communication-Optimization?highlight=usb+serial+data

Others might like to chip in at this point, as I'm just using general knowledge rather than having done this particular trick before.
 
Thank you, but I don't quite understand it.
I need the RAW data in 16 bit format, just like the queues provide it - is it possible this way?
How should the evaluation on the PC side look in this case?

the reply #2 still holds.
the best way to transfer two queues to the is to use USB-Output and connect it to the two queues. This will take the data and transfer to PC.
what you do with data on PC is your business.
You have to write a program that takes in Audio data and provides you access to the data stream.
All this depends on your OS, the tools at your hand and capabilities to program a PC.
 
Hi,
I already write the audio blocks serial via USB.
Therefore I asked if it is so correct or if there are other ways.
I had read something about RAW Hid ( https://www.pjrc.com/teensy/rawhid.html ), but that seems to be not the right thing.

IMHO, using the audio datapath is better than RawHID, if you can live with the predefined sampling rate.
IIRC, with RawHID you have up to 64 byte/ms.
Obviously, with some low-level programming data rates can be changed.
 
Status
Not open for further replies.
Back
Top