Hi
I have acquired recently an Easy pic fusion v7, which contains a DsPic33 microcontroller, on purpose to do some DSP.
I've tested the board with the Mp3 example. It works perfectly. But here's my problem, i wanted to add a flanger effect to the signal, as a result while reading the file, the sound is somehow discontinuous, and the effect has been not applied properly.
Could anyone be with some help ?
Thanks for reading me
MP3_example + flanger
MP3_example + flanger
- Attachments
-
- MP3.rar
- Here's my project, i've only modified the mp3_routines file. Thanks.
- (315.97 KiB) Downloaded 856 times
- darko.ilijevski
- Posts: 581
- Joined: 21 Mar 2017 16:57
Re: MP3_example + flanger
Hello,
For the sound to be reproduced correctly, you need to feed the codec with the data. The moment it's left with no data, it will make a silence and you will have dropouts and distortions in your sound. Now, the operation you're doing in your flanger routine, takes too much time, so - by the time the operations with the buffer are finished, the codec has done playback of the current buffer. The MCU is simply too slow to do it in real time.
What you could do is - possibly take different sized buffer, feed half of the processed buffer to the codec, while you process the other half (or another buffer), so you have enough time to process raw chunks before the codec finishes it's current one.
You could also change the code so it doesn't stress the main CPU with the data transfer while processing the effect, maybe you could use interrupts or some fancy DMA routines...
I hope this will help you find the optimal solution.
Best regards
For the sound to be reproduced correctly, you need to feed the codec with the data. The moment it's left with no data, it will make a silence and you will have dropouts and distortions in your sound. Now, the operation you're doing in your flanger routine, takes too much time, so - by the time the operations with the buffer are finished, the codec has done playback of the current buffer. The MCU is simply too slow to do it in real time.
What you could do is - possibly take different sized buffer, feed half of the processed buffer to the codec, while you process the other half (or another buffer), so you have enough time to process raw chunks before the codec finishes it's current one.
You could also change the code so it doesn't stress the main CPU with the data transfer while processing the effect, maybe you could use interrupts or some fancy DMA routines...
I hope this will help you find the optimal solution.
Best regards
BR,
Darko
Darko