Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem hearing to sound generated by DAC on Arduino MEGA 2560

Status
Not open for further replies.

adwnis123

Full Member level 4
Joined
Jun 19, 2014
Messages
214
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
1,737
After a lot of searching I managed to play a 22kHz 16-bit audio track stored to an SPI SDcard, from the MPC4725 DAC (I2C connected) connected to an Arduino MEGA 2560 R3, but it is too noisy and too loud...! I mean I can understand the volume variations, but not the song. I used a 10K pot to lower the current and then the sound wasn't to loud but I had a lot of noise and I couldn't understand a word from the song. Is there any solution to this? The code I use is this:
https://github.com/deltabeard/MCP4725-WAV/blob/master/wavdac/wavdac.ino

Thank you...
 

i'm not really a software guy, but do you have that address for the DAC set correctly (0x60)? Also, it's not clear to me: what controls the speed at which the data is written to the DAC? It looks to me like there's a WHILE loop that's just going to write data to the DAC as fast as it can.
 
I have set it to 0x62. Ok, I will take a look at the library...
 

file.read() reads bytes, not 16 bit words. I don't think that the code is right for 16 bit .wav file.
 

Digitized audio has become tricky because so many things need to be right. If one of several options is set incorrectly, then music sounds like noise.
A free program called Audacity is useful to play and record digitized sounds. It can help you check your data. It displays waveforms, imports many popular formats, and understands the various options:

* 22kHz or 44 kHz
* 8 bit or 16 bit
* mono or stereo
* big endian or little endian
Etc.
 
I tried (with Audacity) a 22Khz, 8-bit,mono sound, again the same thing ---> a lot of noise! What changes should I make to the code?
 

Hi,

8 bit simply isn´t good audio quality.
Use better resolution.

Klaus
 

When you say "noise" do you mean nothing BUT noise, or noise on top of your expected audio?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top