Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Can someone help me with DMA DirectSound?   Message List  
Reply | Forward Message #13215 of 15019 |

Hi.

I have an application where I have music source data that is
converted to DirectSound samples on the fly (i.e. the entire tune is
too big to be decompressed into one large sample).

I would like some advice on how to do this.

The approach I am considering is a simple double-buffer. Play one
buffer whilst decoding the next music segment into the other.

From some tutorials on the web, I have managed to play a single
buffer, however, I am not sure what to do to flip over to the second
buffer.

This is what I am doing:

1. Setup Timer0 at 44.1kHz to play the sample.
2. Setup Timer1 to cascade, counting N samples and then interrupting.
3. Set DMA1 from the first soundbuffer.
4. Enable Timer0.

Now I'll get an interrupt from Timer1 after N samples.

Q. What do I have to do to seamlessly move over to the second buffer?
- I think I have to:
1. Disable Timer0.
2. Disable DMA1.
3. Reset DMA1 to new source buffer.
4. Reenable DMA1.
5. Reenable Timer0.

This does not work on VisualBoyAdvance (although I have not tried on
my hardware yet).

Please let me know if this approach is ok, and I would appreciate any
other suggestions.

Regards,
David.







Mon Nov 4, 2002 9:54 pm

davidclear
Online Now Online Now
Send Email Send Email

Forward
Message #13215 of 15019 |
Expand Messages Author Sort by Date

Hi. I have an application where I have music source data that is converted to DirectSound samples on the fly (i.e. the entire tune is too big to be...
David Clear
davidclear
Online Now Send Email
Nov 4, 2002
10:17 pm

... In other words, you're working on a music player based on ADPCM or sub-band audio coding, right? Or is your "compression" really just a MIDI or MOD...
yerricde
Offline Send Email
Nov 5, 2002
9:29 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help