Forum Discussion
Altera_Forum
Honored Contributor
14 years agoOk, I got it running now. The problem was the output method of the minimad.c example. I have now written some new code for it, see below.
//j is a global variable, that i use to count the length of the pcm.
//I use it to output from the sram in another method
while (nsamples--) {
unsigned int sample;
//i am sure, that i only decode stereo, so I don't check nsamples == 2
unsigned int audioausgabe = 0;
//sample = scale(*left_ch++);
sample = (*left_ch++);
audioausgabe = sample&0xFFFF;
audioausgabe = audioausgabe << 16;
//sample = scale(*right_ch++);
sample = (*right_ch++);
audioausgabe = audioausgabe|(sample & 0xFFFF);
//write to sram the resulting 32bit word
IOWR(SRAM_BASE,j,audioausgabe);
j++;
}