Play audio sample from external and internal memory

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_1665606
Level 2
Level 2
First like given

I was wondering how does one play samples? The first thing I'd like to achieve is to play a sine wave from a waveform sample. I wonder if I can do that or is there a simpler way?

   

Store raw audio in EEPROM -> drive DMA with clock or PWM -> pipe DMA output to DAC 

   

If there are any examples or application notes on this, I'd really appreciate that! Also, can I play audio from external memory (as in SD card)?

0 Likes
4 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

We do not have an example for PSoC5LP. But please have a look at the obsoleted AN regarding PSoC1, (Link:http://www.cypress.com/file/327276/download).You can follow same implementation.

   

Thanks,

   

Hima

0 Likes

Excellent, thank you! I'd love to see more audio-related articles, PSoC is perfect for such tasks. 

0 Likes
user_1665606
Level 2
Level 2
First like given

I figured the easiest way to do it is to read wav (raw audio) from one of the memory locations (SRAM, EEPROM, etc.), pipe it through the DMA which is triggered (request) by clock signal to DAC: memory-->DMA-->DAC. However when using the DMA Wizard, it asks for two parameters I don't know: 'length' and 'source' in the transaction descriptor. How do I define the source and the length? 

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

You can use RAM-DMA-VDAC8 example http://www.cypress.com/comment/358351#comment-358351 The issue with DMA is max transfer length of 4095, so you have to chain DMA for long music samples (hint - at audio frequencies CPU is sufficient to play short sounds).

   

 

   

Another thread on same subject might be informative (but not instructive):

   

http://www.cypress.com/comment/344636#comment-344636

0 Likes