Go Down

Topic: Arduino Sound Card (Read 12689 times) previous topic - next topic

MatthieuT

Hi,

I want to use a Arduino as USB audio input device with 2 mic!
So I want that my arduino is a sound card on my windows.
I saw on this forum it's possible to do a little modification to the USBCore to use the Leonardo as usb audio device for isochronous input streaming.
Someone could tell me how could I do?

I have a Arduino Mega 2560 but I can buy a Leonardo or other Arduino if it's not possible on the Mega2560.

Thank you a lot!

Matthieu T.

Grumpy_Mike

Quote
Someone could tell me how could I do?
No you miss read that.

Quote
use the Leonardo as usb audio device for isochronous input streaming.
Are you sure you are not mixing that up with a USB HID MIDI device.


Quote
I have a Arduino Mega 2560 but I can buy a Leonardo or other Arduino if it's not possible on the Mega2560.
The Leonardo uses a processor that has USB capabilities where as the Mega's processor does not. So even if this trick were possible which I doubt, you could not use it on a Mega.

liamorourke

Arduino will only handle very low sample rates compared to the standard 44.1khz which you would require minimum for audio (for musical purposes). It's due to the clock speed and the inbuilt analogue-to-digital converter. Here... read this article: -

http://apcmag.com/arduino-analog-to-digital-converter-how-it-works.htm/

In particular, the section entitled 'Successive Approximation'. It explains how the ADC in an Arduino actually works and then goes on to show how, due to 'Niquist Theorem' the highest possible sample rate you can achieve with an Arduino UNO R3 is 4.8khz which in comparison to CD-quality (44.1khz) is pretty bad.

MatthieuT

Thank you !
But I need to have two input So a stereo input for a low price...
The arduino would could a good choice ...
Someone have any idea ?

Grumpy_Mike

Quote
The arduino would could a good choice ...
No.

pjrc

#5
Mar 20, 2016, 06:31 pm Last Edit: Mar 20, 2016, 06:33 pm by Paul Stoffregen
Someone have any idea ?
Maybe check out Dean Camera's LUFA library.  As far as I know, it's the only USB audio implementation for these AVR USB chips.

After you've tried to actually use LUFA, you can decide if this advice was actually helpful or not.....

Maybe, just maybe, if you get this to actually work, or even make partial progress, you might share the code or anything you learn?  Recently many people ask this question.  So far, nobody seems to do anything... or if they do, they are unwilling to share.  I hope you might?

Wei1234c

This may do the job.

7.1 Channel External USB Sound Card Sound Box with Driver CD Digital Audio Streaming Vista Sound Card Adapter for Computer
 http://s.aliexpress.com/aE7BrAJN?fromSns=Copy to Clipboard

pjrc

Since this thread started (back in 2016), I did manage to implement USB audio (isochronous streaming) on Teensy 3.x.  If anyone's curious, here is the source code.

https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_audio.cpp

https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_audio.h

This streaming integrates with the Teensy Audio library.  In the design tool, you draw the USB input & output onto the canvas and patch them into the rest of your audio system.  That way you can synthesize sound, or capture it from the ADC pins or from a shield with a proper audio chip using I2S digital audio protocol, or any number of other sources and send them to your PC.  It can also get the PC's output and feed it through effects or other stuff and send to anything else the audio library supports.

There's pretty much no way to do this sort of stuff on the older 8 bit boards.  But the faster end of the newer 32 bit chips are more than capable enough to process 44.1 kHz streaming audio.


Go Up