phat code Is the glass half empty, half full, or twice as large as it needs to be?
Main

Projects

Downloads

Articles

Links

Forum

 

View Message

Back to Messages
Plasma Wed Nov 3 2021 at 12:57 pm
I recommend using DMA
 
 
It uses a lot less CPU and you can specify the sample frequency without needing accurate timing.

Here is a simple QB example with single-shot DMA (requires EMS):
http://www.phatcode.net/articles.php?id=208

If you want to do more advanced things like mixing you can set up a double buffer with auto-init DMA. Then SB will automatically play the buffer in a loop. But you will need an interrupt handler to update the buffer at the proper time.
 
 
 
 

Reply to this Message

Name
Subject
Message

No HTML is allowed, except for <code> <b> <i> <u> in the message only.
All URLs and email addresses will automatically be converted to hyperlinks.