flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
f0dder 18 Jul 2004, 00:49
Didn't it play at all, or did your main thread reach ExitProcess before the sound even started?
(PS: what about using nice symbolic constants rather than hardcoded magic numbers?) |
|||
![]() |
|
crc 18 Jul 2004, 01:00
It doesn't play it at all with "$20000 or 1"
![]() Since I only call this in one routine, I didn't see much value in putting the numbers in as symbolic constants. |
|||
![]() |
|
f0dder 18 Jul 2004, 01:12
Well, if you have the symbolic constants available (header/include files, whatever) there's not much reason not to use them - and it makes it quite a bit easier to see wtf is going on
![]() I mean, given your problem it was quite easy to guess that "1" had to mean "async", but SND_FILENAME or SND_ASYNC is a bit easier to read than the hardcoded numbers :p Sounds a bit weird that you get no sound if the program is still running... can you reproduce this in a small test? |
|||
![]() |
|
crc 18 Jul 2004, 02:22
I'm wondering if the problem is due to the use of a DLL. See, I have a DLL implementing a Forth interpreter/compiler. The app implements several functions, which are then wrapped in Forth. (E.g., the Forth word in the DLL calls the assembly routine in the app). This works, from within Forth, but not from with the event loop. I can post the entire code as a .zip file, but I haven't managed to duplicate the problem outside this program
![]() |
|||
![]() |
|
f0dder 18 Jul 2004, 02:37
Ugh, this sounds pretty weird :-s.
Hm, you say within event loop - could it perhaps be that you trigger PlaySound multiple times? (Try putting a int3 or MessageBox before the PlaySound call) |
|||
![]() |
|
crc 18 Jul 2004, 03:16
Thanks! That was the problem. Adding "OR $10" to the invoke fixed it. Thank you again!
|
|||
![]() |
|
f0dder 18 Jul 2004, 03:29
SND_NOSTOP you mean
![]() |
|||
![]() |
|
crc 18 Jul 2004, 03:40
Yup
![]() |
|||
![]() |
|
crc 18 Jul 2004, 05:50
Ok, how about this: Is it possible to play two audio files at the same time? For example, background music and sounds over the background music.
|
|||
![]() |
|
f0dder 18 Jul 2004, 09:20
You'll need to look into more advanced code than PlaySound, then. There's basically two major ways to do this: WAVEOUT and DirectSound. With DSound you can either use hardware mixing, or do your own. With WAVEOUT, you have to do your own mixing.
If you don't feel like writing "a bunch of code", perhaps take a look at one of the existing sound libraries like BASS, FMOD, OpenAL (overkill?), or whatnot. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.