Keep in mind that
winsound only works for WAV files, so if you’re using MP3s, it won’t work. A cool thing that
winsound can do is beep the speakers on your PC by calling the
Beep() method. Let’s just comment this out real quick.
And if you call
winsound, you can say
Beep(), and if you wanted to do a 1000 Hz tone for 100 milliseconds, you could just do that. For a project that’s going onto a PC, this can be a great way to notify a user that something has happened. Just by adding one line of code, you can add in beeps of different frequencies for different durations without needing to create your own sounds or import different filenames.
Become a Member to join the conversation.