I am developing a game in GW-Basic.i want to add music to it but the problem is that i am unable to play in the background but when i add sound then first the sound is played then after that game execution is started and vICE vERSA .while i want that both things play at the same time..so any idea how to do it??
Asked
Active
Viewed 1,041 times
1
-
You should look into SoundBlaster programming. IIRC, you could set it up to generate interrupts where you'd fill up a buffer with PCM data, which then is DMA:d to the audio DACs. But I'd really recommend you to _not_ use GW-BASIC. Using something like SDL would be much, much easier (and more portable). – Michael Oct 31 '13 at 14:11
-
Maybe you can emulate concurrency :D . Make a fake executor queue. Put each note just after small packets of work. But That would make it very difficult to create a known soundtrack. – huseyin tugrul buyukisik Mar 05 '14 at 21:27
1 Answers
2
This is actually possible. Use the PLAY "MB"
statement to enable "music background" mode. In this mode all PLAY
notes and SOUND
s are queued and executed in the background while your program is running. You can queue up to 32 notes. Look up PLAY
in this manual.

pdw
- 8,359
- 2
- 29
- 41