music please
One of the things I missed a few times in ABAP was playing a sound. Not that it would be very important in my daily work but it’s one way to give the user a feedback. Think of a loud “tada” when selection has ended, ALV is displayed and the user needs to be woken up … 😉
Thanks to Enno Wulff’s contribution on “I <heart> ABAP“, I remembered using ABAP and OLE in several projects to access data from Excel and Outlook. But somehow I never checked wether Windows Media Player can be controlled by OLE. The answer is “yes”, here is the documentation (check “Object Model Reference“).
I wrote a little demo which you can get from GitHub. My goal was to play/stop music file “C:\Windows\Media\town.mid” when pushbutton is pressed.Therefore just two pushbuttons in the demo:
With the Microsoft documentation I think it’s easy to enhance my class so you can increase volume.
As preperation you have to register Windows Media Player in transaction SOLE as an OLE application once. You can choose your own name for the OLE application. I used “WMP”. Furthermore a ClassID is needed which I took from the Microsoft Answers Forum. It’s {6BF52A52-394A-11d3-B153-00C04F79FAA6}. On my Windows 7 and Windows 10 installation that worked fine.
Have fun trying it and see you soon
Michael
Your next step could be adding 'voice' to your program (with SAPI.SpVoice)
Something like that:
https://www.tricktresor.de/blog/speak/
? 😉
Yes, or Text to Speech ,SAP system will speak to you !!!! in blog section of forum.
Great idea. So I don't have to buy radioplay. Now I can listen to longtext of error messages. Just a joke 😉 That's another interesting technology. Thanks for the note.
There was something similar from Thomas Jung a long time ago:
https://blogs.sap.com/2005/05/11/using-classic-activex-controls-in-the-abap-control-framework/
I think Stefan Schnell did something with ActiveX/Windows Media Player, too. But I cannot find the blog link at the moment 🙁
Hello Michael,
your can find my blog here.
Best regards
Stefan
It's a pity, Merlin has gone... ;(
He could also be programmed in SAP via OLE.
Didn't work very well, but it worked.
Merlin was a nice agent. That would have been fun to control his movements via OLE 🙂
Yes, but also annoying.
I tried here to guide a user through a "form" and enter data. Merlin reacted not very good and fast on field changes or keyboard input.
Nowadays with more experience with gui controls it might be nice to let Merlin pop up when the user clicks on tree nodes or tab...