Hi, I am trying to make an wav player using LPC2148.I have interfaced SD Card by SSP.now reading buffer of data from sd card and writing 8 bits to DACR register.some beep kind of noise is coming continuously but song sound is not coming...Can anyone help me...?? This i wrote to send data to DAC.
data=SoundData[i]; val= data<<6; val *=volume; DACR = (val & 0x0000ffc0);}
Silly question, but have you tried with pen and paper to take some different "music" values and perform the above code on and see what you end up with? Not for example the problem with integers and a "volume" multiplication.
You have to play the samples at the correct rate...
Test with sine wave.
It's normally easiest to create an array with samples for a sine wave and test playing it while verifying that everything works ok. When a 1kHz sine wave comes out as a 1kHz sine wave with no more distrosion than caused by sampling rate and number of bits of the DAC, then it's time to draw real audio data from a memory card and feed to the DAC.
Doing all steps at the same time just means it's impossible to know which of the steps that fails.
ok i ll try 1st wid sine wave.. Thanks for your reply..