Audio signal over USB as a sound card

Hello, I want to send a simple mono audio signal (for example, a sine wave) over USB to my pc. I want the Arduino to send some simple audio over USB as a class compliant sound card. How could I do that?
EDIT: basically have the Arduino act as a synth and on some button press send audio as a class compliant sound card

If you're using an Arduino like the Leonardo or Due, you can make it act like a USB MIDI (Musical Instrument Digital Interface) device. This will let you send musical info to your PC. The Arduino MIDIUSB library will be handy for this.

You'll also need to generate the audio signal you want to send. This could be as simple as a sine wave. There are lots of online tutorials on how to do this with an Arduino.

Just remember, MIDI sends note and control data, not the actual audio. If you want to send actual audio data, you'll need an Arduino with an audio codec or a separate audio interface module.

This is a bit of a project and might take some learning, especially if you're new to Arduino or audio signal processing. Start with some basic tutorials and you'll get there!

Thanks for the quick answer, I am well versed in audio, but not in developing digital signal processing. So no chance I could get Arduino Uno to literally just send a sine wave to audio input over USB? Just like a mono sine wave? I could think abt MIDI afterwards then
EDIT: perhaps with some additional circuitry over digital pins?

The Arduino Uno can't directly act as a USB sound card to send audio. However, you can generate a sine wave via a digital pin using PWM and input this to your computer through an external sound card or audio interface. For better sound quality, consider using a microcontroller with a built-in DAC or an external DAC, and ensure proper filtering and level adjustments.

Thanks for the info, I want to use the Arduino as DSP chip, it seems possible if I reporogram the USB chip but that seems like a hard task

Reprogramming the USB chip on the Arduino Uno is indeed a complex task and usually not recommended, especially when there are other microcontrollers or modules available that can handle these tasks more readily.

If you're interested in using Arduino for digital signal processing (DSP), you might want to consider using an Arduino model with more capabilities, such as the Arduino Due, which has a built-in Digital-to-Analog Converter (DAC). Alternatively, you could use an external DAC with the Uno.

Another option is to use the Teensy line of microcontrollers, which are similar to Arduinos but have more powerful hardware and also support the Audio Library, which makes DSP tasks much simpler.

In any case, if you're getting into DSP with microcontrollers, it will involve a good amount of learning about both the software and the hardware, but it can also be a very rewarding and educational experience.

Which Arduino? Most can't even begin to approach the capabilities of a DSP chip.

Eight-bit Arduinos like the Uno are not really suitable for any audio synthesis or recording task.

I am mainly looking to do something that is dsp with it, not high quality stuff, like anything any quality would do

Can you give some examples?

Idk take a signal in any quality applicable, filter or delay it (I bet this could be done without fast floating point maths) output it, but really just anything that outputs a sine wave on a button press would do