Code Snippet To Play Sounds With Delphi XE7 Firemonkey On Windows and Mac OSX

Delphi XE7 Firemonkey Play Sound Windows Mac OSXDeveloper CHackbart has a play sound code snippet for Firemonkey over on one of the Delphi forums. The posts are all in German but you can run it through a translator easily enough. The code snippet was written for one of the earlierĀ versions of Delphi but I tested it out in Delphi XE7 Firemonkey and it plays sounds on both Windows and Mac OSX. On Mac OSX it uses the NSSound object (as TNSSound) and on Windows it uses the PlaySound Win32 API call. There are other ways to call NSSound but this way worked on a very recent Mac OSX version. It should also work for you in Appmethod. If you are looking to play sounds on Android and IOS as well you should check out the TGameAudioManager component. Here is the code snippet:

Check out the full forum post over on DelphiPraxis.net or just use the code snippet above.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Code Snippet To Play Sounds With Delphi XE7 Firemonkey On Windows and Mac OSX by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

One Response to Code Snippet To Play Sounds With Delphi XE7 Firemonkey On Windows and Mac OSX

  1. Hackbart says:

    Yepp, this has been written by me. The code-passage is part of the first steps i made on Android/iOS development. The main project based on Minicraft – a LD game build by Markus Persson. You still can find the complete Delphi code under http://www.dvbviewer.tv/download/minicraftsrc.zip.

    Christian

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Delphi XE7 Firemonkey Timeline Component And IDE Editor
Prototype Timeline Component And IDE Plugin For Delphi XE7 Firemonkey On Android And IOS

If you have ever used any kind of animation software (like Adobe Flash Pro) you are familiar with the concept...

Close