Delphi: Difference between PlaySound and SNDPlaySound
Question by Guest | Last update on 2021-04-06 | Created on 2012-08-23
I wonder what the difference is between the two Delphi functions PlaySound and SNDPlaySound.
To me, it seems as if the two functions do the same and there is no difference. Or is there one?
Related Topics
Delphi: Play System-Sounds
Tutorial | 0 Comments
Delphi: Global Treatment of Errors (Exceptions)
Tutorial | 0 Comments
Original Delphi is too expensive - Are there Alternatives?
Question | 3 Answers
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Delphi/Lazarus: 3 Ways to round a Number to X Decimal Places
Tutorial | 7 Comments
Lazarus/Delphi: Width and ClientWidth - Difference
Info | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
SNDPlaySound is an old function, PlaySound is the new extended function.
For compatibility reasons, the old version is still supported. So, to be prepared for the future, you should rather directly use PlaySound, because maybe at some point the support of SNDPlaySound can be given up.
Another difference arises from an additional parameter in PlaySound:
With PlaySound, there is an additional option to indicate a handle to a resource (in the example "handle"). This makes it possible to play sounds directly from a resource. The top two lines of the code, both play the file "test.wav", once with PlaySound and once with SNDPlaySound.
Last update on 2021-04-06 | Created on 2012-08-25