#10338 - funkeejeffou - Tue Sep 02, 2003 7:56 pm
Hi,
I've managed to sample a 6 second loop. My code does this :
DMA1 sends data to the FIFO each time timer 0 overflows, and when timer 0 overflows an IRQ is generated. Each Time an IRQ is generated, I keep a variable in IWRAM that is incremented by one.
The sound frequency I use is 6000Hz, and as my loop is 6 second long, everytime my variable reaches 36000, I reinitialize my variable to 0, stop the DMA transfer and reinitialize it so that the sound loop is played from the beginning. That's a personnal algorithm, and it's the first time that I try sampling a sound loop in software.
The problem is that at each loop end, there is some distortion, and I doubt my code is the best.
How does professional developpers manage to have a clean and precise sound looping?
Any suggestions are welcome.
Cheers
I've managed to sample a 6 second loop. My code does this :
DMA1 sends data to the FIFO each time timer 0 overflows, and when timer 0 overflows an IRQ is generated. Each Time an IRQ is generated, I keep a variable in IWRAM that is incremented by one.
The sound frequency I use is 6000Hz, and as my loop is 6 second long, everytime my variable reaches 36000, I reinitialize my variable to 0, stop the DMA transfer and reinitialize it so that the sound loop is played from the beginning. That's a personnal algorithm, and it's the first time that I try sampling a sound loop in software.
The problem is that at each loop end, there is some distortion, and I doubt my code is the best.
How does professional developpers manage to have a clean and precise sound looping?
Any suggestions are welcome.
Cheers