Play Sound through Serial communcation (from Laptop) on speakers connected to AD5669 using Arduino

Thread Starter

ronbo76

Joined Apr 2, 2018
20
Hi, I am working AD5669 which is connected with Arduino and can convert the digital values to analog values I do have a speaker also and I need to know, whether it is possible to connect the speaker with DAC(connected to Arduino via I2C) and I need to play sound using through speaker using serial communication between Arduino and laptop.
Can any suggest me in the right direction to make this kind of solution work?
 

MrChips

Joined Oct 2, 2009
19,269
As is common place, you are telling us your hardware solution rather that telling us your goal.
Why don't you give us the big picture of what you are trying to accomplish?

You have a digital sound file (e.g. mp3 format) on your laptop and you want to play the sound.
Why not play the sound from the laptop audio output?
What does the Arduino have to do with this?
 

MrSoftware

Joined Oct 29, 2013
1,551
As mentioned above, check to make sure your DAC can provide enough current to drive a speaker. A much less expensive, and much better (for driving speakers directly) solution is an audio amplifier with I2S interface, like this one:

https://www.sparkfun.com/products/14809

I suspect another challenge is going to be the limited bandwidth of the serial port. Can you send audio data over a serial connection to an arduino? Absolutely. Can you send it fast enough to get good sound quality? Run the numbers and find out. Determine the sample frequency that you would be happy with (Audio CD quality is 44.1kHz), multiply by bits-per-sample, multiply by number of channels (left+right, only left, etc..), then compare to your actual serial port throughput to see if there's enough bandwidth.

For example, CD audio is 44,100 samples/sec * 16 bits/sample * 2 channels = 1411200 bits/second, which I suspect is beyond the capabilities of a typical arduino serial connection. If you settle for 8kHz sample rate, 8-bits/sample and a single channel, then you only need 64000 bits/second, much more realistic for the arduino, but at the cost of sound quality. I don't know the max capabilities of the arduino so only take this as a general description.
 

ScottWang

Joined Aug 23, 2012
6,816
I think you better show us a block diagram and arrow, it is more easier to understand what are you trying to do, save guessing save time.
 
Top