flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Fanael 09 Nov 2009, 21:57
PlaySound function + SND_MEMORY flag does what you want.
|
|||
![]() |
|
comrade 10 Nov 2009, 06:32
Artlav, check out the attachments, let me know if it helps.
The attachments are: waveplay.zip is in FASM. It is for an old version of FASM, I am not sure which. It probably won't compile with the latest FASM. This example parses a PCM .wav file and plays it out from a sound buffer. Also check out zhirik.wav in this zip file, I think you'll like it ![]() toneplay.zip is in C. It generates a wave, puts it in a buffer, and uses the same APIs to play it from that buffer. The Tone field specifies what frequency to generate, and the Length specifies for how many seconds to generate it. I just looked at this 7 year old source, and it looks I was generating a saw-tooth wave. Both samples are not commented well. If you are looking for a better example, just look for anything using waveOut* APIs (Windows Multimedia APIs). There should be lots of stuff on www.codeproject.com, www.codeguru.com, or even www.wasm.ru. Or even in the Windows SDK. Another alternative is DirectSound, but I've never used that. Remember, your real question here is what API to use. It does not matter if its written in assembly, C, or Visual Basic.
|
|||||||||||||||||||||
![]() |
|
bitshifter 10 Nov 2009, 07:44
Also dont forget about OpenAL.
Its the best choice for games. Its easy to use with multichannel and 3D mixing. But for simple windows events i would use PlaySound. Like for custom button click sounds and such... |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.