2008 Apr 14 2:10 PM
Hi.
I was wandering if there is a way to play a WAV sound-file through ABAP.
There is a way to add such kind of file to the Business repository (Transaction 0FPM002) and by double-clicking it SAP knows to play it, like it knows to display a GIF object by double clicking.
The question is how to implement it in the UI.
The GIF object I'm implementing through a Custom-container that hosts the object, but this of course, does not work for the WAV object.
All ideas will be welcome.
thanx.
ayal.
Hi.
I was wandering if there is a way to play a WAV sound-file through ABAP.
There is a way to add such kind of file to the Business repository (Transaction 0FPM002) and by double-clicking it SAP knows to play it, like it knows to display a GIF object by double clicking.
The question is how to implement it in the UI.
The GIF object I'm implementing through a Custom-container that hosts the object, but this of course, does not work for the WAV object.
All ideas will be welcome.
thanx.
ayal.
2008 Apr 14 5:23 PM
I have played sound using two techniques.
To play a wav you must envoke media player and have the wav on the PC's which will play it. This code opens media player plays the wav and then closes the player. I haven't figured out to get media player just to execute in background.
call function 'GUI_EXEC'
exporting
command = 'mplay32.exe /play /close c:\temp\info.wav'.
2008 Apr 15 8:14 AM
Dear Joseph.
Your response were very helpfull.
I don't know if I can use it since we need a quick response (The scenario: employee scan products and need to know if they are in warranty or out of warranty).
If we could load the program, even in the foregroud, and just send files to it, that would be much faster I believe.
I'll keep testing and will update post if I'll make progress.
thanx.
ayal.
2008 Apr 15 2:58 PM
If you work a solution that plays wav without a foreground application, I would be most interested as well.
In some of my sound requirements I needed to make a beep below is code on just envoking a single beep from the PC.
type-pools:
ole2.
data:
return type i,
sapinfo type ole2_object.
data:
begin of command,
command(12) type c value 'cmd /c echo ',
hex07(1) type x value '07',
end of command.
create object sapinfo 'SAPINFO' no flush.
call method of sapinfo 'EXEC' = return
exporting
#1 = command
#2 = 0.
free sapinfo.
2015 Dec 28 11:15 AM
2019 Aug 02 6:05 PM
Hi Guys,
I tried to use the code echo above but cannot play a sound...I'm using windows 10.
hope you can help.
Thank you.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |