![]() For instance, you can use XAudio2 instead: You need to use a more powerful multimedia API than PlaySound(). Depends what your console is supposed to be.? are you writing game or just media player? or just testing.? Like this, still I do not know what music library would be best to use. ![]() However, I solved it by converting all my music to. It did work, however, upon downloading test project and using their. Allthough I used like 3 converters, and downloaded many files through internet, it did not work. Next drawback was figured by me, and that a wav file does not load, saying that the format is not correct. Second drawback is that it needs a bit more coding than just type PlaySound(TEXT("mywavsound.wav"), NULL, SND_FILENAME | SND_ASYNC) // - the correct code Some people said they fixed it by putting volume up to 100 but it did not work for me. Upon research, I found out that this is for long time a bug in library, and still not fixed. Upon making it work, wich took me hell lot of time, I figured out that audio crackles and is low quality, allthough the original file plays fine in media player. It supports wav and oog and much more file types. I will not go to further detail on instalation. The library is aviable for Windows (DLLs and header files) and Linux (installation through console). If you know what you are doing, you can write code that compiles on both OSses.Īnother good thing is, that you can play multiple sounds at once (maybe even up to 30, but check it online). The good point is, that SDL_Mixer is multiplatform (tested on both win, linux). So far I was looking for any good way of playing audio, and making it work, I came to this. However, for playing more sounds at once.įor this purpose, you can do it by using SDL_Mixer. Now I am wondering how I can get 1 or more sounds to play at once, for if I call PlaySound() twice with that flag it will stop the 1st one and play the 2nd. using the PlaySound(TEXT("mysound.wav"), NULL, SND_FILENAME | SND_ASYNC) does anyone have an example of a code using SND_ASYNC? I know about the SND_ASYNC thing but I do not know how to use it, I can't seem to use it without the thing not compiling. How do I add the wav file so it compiles as a release? Of it, for example when you press enter it will plays a sound Is running? Also it would be great if I could play other sounds on top How can I play sounds without freezing the console, so I can forĮxample play looping music file while the project PlaySound(TEXT("mywavsound.wav"), NULL, SND_FILENAME | SND_ASYNC) // - the correct code ![]() PlaySound(TEXT("mywavsound.wav"), NULL, SND_FILENAME) - My erroring code When I try to compile as a "release" it errors with a "linking error" - fatal error LNK1120: 1 unresolved externals. ![]() When the sound starts playing, the application freezes until it finishes playing. This test works(kind of), as it will play a sound file, but there are 2 problems. but i wanted to jaz it up a bit and add some sounds. So I have been playing with the console as I am at that level, and we have been asked to make our first "project" for a assessment. EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM
0 Comments
Leave a Reply. |