Text to Speech ,SAP system will speak to you !!!!
It was friday , A famous day where people look at their watch 3 times more than often.
And techie like us try some R & D.
for me Last friday , target was OLE statements :
If you are not sure what is OLE , then let me tell you in short: its used to talk with presentation server. The ABAP processor normally buffers all successive OLE statements and sends them in a bundle to the presentation server and it will be executed there. Like : speech , excel integration etc..
For Text to Speech i created an object :
create object voice ‘SAPI.SpVoice’.
which is used while calling a method “Voice”.(which converts the Text to speech )
The Report which i created had a simple selection screen for a meeting request.
Like : meeting name
Date
Start time & End Time.
and a validation : “meeting Start time should be less than meeting EndTime”.
Copy paste the below report , and try entering meeting End Time less than meeting Start time.
this time with a normal error message display you can hear the error message too.
*&———————————————————————*
*& Report ZTST_SCHEDULE_MEETING
*&
*&———————————————————————*
* copy the text elements
*P_DATE Date
*P_MEND Meeting End
*P_MNAME Meeting name
*P_MST Meeting Start
*&
*&———————————————————————*
report ztst_schedule_meeting.
tables : zmeetings.
include ole2incl.
parameters : p_mname type char20.
parameters : p_date type dats.
parameters : p_mst type sy–uzeit.
parameters : p_mend type sy–uzeit.
data : ole type ole2_object,
voice type ole2_object,
text type string.
data : lv_time type t.
at selection-screen.
create object voice ‘SAPI.SpVoice’.
if p_mend < p_mst.
text = ‘Meeting Start time should be less than meeting End Time.’.
call method of voice ‘Speak’ = oleexporting #1 = text.
message ‘meeting Start time should be less than meeting End Time’ type ‘E’.
endif.
Hi,
Is it the link help u?
http://sapignite.com/lets-ask-her-out-for-a-tea-send-meeting-request-to-outlook-text-to-voice-sap-abap-ole/ 🙂
Hi Gourav,
Actually i am the guy who wrote that article :-).
Thanks
~Raj
I saw that on top, it is very good and working fine....
nice..
Gourav.
Thanks Gourav,
~Raj
Delighted ,
can we change female voice to male voice,?
Hi Abhishek,
I was checking it.But i think there are no parameters are provided where we can change the frequency of the voice .. may be need to go more at system level coding to change it .. 😉
Thanks
~Raj
get property of spvoice 'GetVoices' = sptocket_all.
* DOESN'T WORK, IN VBS THE FOLLOW ISTRUCTION WORKS
http://www.tricktresor.de/blog/speak/
for SAPI.SpVoice properties:
https://msdn.microsoft.com/en-us/library/ms723609(v=vs.85).aspx
also play voice file etc. .WAV file.