Playing a wav-File on Forms

Stefan_Limpert
Member Posts: 30
Hi Folks,
I have a little problem. I like to play an arbitrary Wav-File when opening a form. How must I proceed? Is there a easy solution? The "Speaker-Beep" is so terrible,you know.
I have a little problem. I like to play an arbitrary Wav-File when opening a form. How must I proceed? Is there a easy solution? The "Speaker-Beep" is so terrible,you know.
0
Comments
-
It's fairly simple, if you have the Microsoft MultiMediacontrol available as OCX.
1) Define "Sound" as a variable of type OCX, subtype "Microsoft Multimedia Control, version 6.0" (in my case, check yours)
2) In the OnOpenForm trigger (or in fact, at any place you would like to play some sound) you put the following code:
Sound.Notify := FALSE;
Sound.Wait := TRUE;
Sound.Shareable := FALSE;
Sound.DeviceType := 'WaveAudio';
Sound.FileName := 'C:\WINDOWS\MEDIA\CHIMES.WAV';
Sound.Command := 'Open';
Sound.command := 'Play';
For 'filename' you can, of course, fill in any wave file you like and which is avaialble to all users.
Small warning, though: Adding some sound can spice up the use of a program (Navision not excepted), but please be modest in the selection which sound you use for which event. Irritation isn't far away here.
John0 -
Thanks John i will try it.
Regards Stefan0 -
Hi John,
I did not found the right OCX were you talking about.Where can I get it?0 -
Stefan,
The filename of this OCX is MCI32.OCX in the Windows/System directory. I'm not sure if it's a standard Windows control, because I have a couple of development environments on my system. But I believe it comes with Windows Mediaplayer also.
John0 -
I already downloaded and registered MCI32.OCX
encountered error message:
Could not invoke member Shareable. The OLE control or Automation server returned the following message:
The number of elements provided is different from the number of arguments accepted by the method or property.
any hints? :-k0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions