Thursday, May 8, 2014

Lab 15. Space Invaders. Testing module IV (Sounds)

Hi!

I'm just done with my sound test function and guess what ... It works. I'm so happy.



In fact the important thing finally, apart from the DAC, it was "the delay" between the chain of sounds.

My hypothesis: (I've got not taken an scope and maybe my guess is wrong but it makes sense to me) the clock time of the processor is 80Mhz which is way faster to run all my tests (at 11Khz with about 1sec in total of real sound). If you don't put a delay you won't be able to hear anything.

I was having as well a wrong interrupt, another part of my problem.

Finally my working sound_test function looks like this (all the rest equal):

// Testing Tools
void Sound_Test (void)
{
// Predefined sounds
Sound_Killed();
Delay100ms(20);
Sound_Shoot();
Delay100ms(20);
Sound_Explosion();
...

Here you can find the most significant files for the test:



During the Delay100ms I've the time to go through all the sampled sound with no other interruptions apart the one I'm interested.

And that's it, thx again to all of you

No comments: