Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Can I access sounds in a sounds folder
I have been learning to program in Windows using C on a PC running Windows XP and Petzold's Guide to Win32 API.
I wrote some short programs which use calls such as PlaySound (TEXT ("click.wav"), NULL, SND_FILENAME | SND_ASYNC) ; to play the sounds. All worked well.
However I decided to tidy up the sounds by placing them inside a folder called 'sounds'. I then called them using calls such as PlaySound (TEXT ("Sounds/click.wav"), NULL, SND_FILENAME | SND_ASYNC) ;
Again all worked well on Windows XP. However, I am a teacher, and at school we use Windows 92 and 98. On 95 and 98 the call to PlaySound produces silence unless I remove the sounds from the sounds folder and keep them beside the application.
It really does look better to keep all the sounds inside a sound folder. Is there any way that I can do that and have this work in XP and earlier OS?