View Single Post
Old 16 January 2020, 04:25   #2
FSizzle
Registered User

 
Join Date: Nov 2017
Location: Los Angeles
Posts: 36
The Audio interrupt triggers not at the end of playback, but rather shortly after the start when the audio registers have been internally copied. This allows you to queue the "next" waveform shortly after the start of the current one so that you can have seamless playback.

In your interrupt, you are stopping the DMA at the very start of playback, which is why you no longer hear anything. As I understand it, the correct way to stop the audio from looping is in the interrupt to set it to point to a short and "empty" sample so the "next" sample plays nothing.

If you really want to stop DMA entirely, then you'll need to do that on the second interrupt (for the start of the "empty" sample). You usually need to track some global state for your interrupt to know what state a given channel is in and what you should do.

Last edited by FSizzle; 16 January 2020 at 04:38.
FSizzle is offline  
 
Page generated in 0.04289 seconds with 11 queries