Forum Stats

  • 3,752,115 Users
  • 2,250,461 Discussions
  • 7,867,726 Comments

Discussions

Playing Audio - Forms 12c new features

buggleboy007
buggleboy007 Member Posts: 280 Bronze Badge
edited Nov 16, 2020 9:11PM in Forms

Hello Michael,

We wish to play an audio that has been recorded when a specific form is launched. This is what we have done:

a) recorded a file and named it as po.mp3

b) gave the file to middleware who then signed it into a jar file (as mentioned in the new features document). These were his words "The file is accessible from /apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar"

c) based on the above, I called the file in WHEN-NEW-FORM-INSTANCE as :

  1. PLAY_AUDIO('po.mp3'); This resulted in no luck.
  2. so tried: PLAY_AUDIO('http://srv-fm1:7777/forms/icons/audio.jar/po.mp3'); Even this resulted in no luck.

Is there anything else that needs to be done that is missing? Please advice.

Thanks in advance!

PS: For a known issue mentioned by Oracle for Forms: 12.2.1.1.0 (which is what we are using)

2.3.9 Oracle Forms does not play Audio Files using URL served by WebLogic Server

Oracle Forms audio functionality does not works if the URL, to obtain an audio files, is served by Oracle WebLogic Server. The audio file will fail to load.

The URL for the audio files must be served by the Oracle HTTP Server. Audio files delivered in JAR file can use URL served by either Oracle WebLogic Server or Oracle HTTP Server.

I checked with my DBA if the above is causing an issue and here was his reply:

We are using weblogic. We run Oracle HTTP Server on top of the WLS_FORMS / WLS_REPORTS managed servers. 


Best Answers

«1

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,815 Employee

    If the file is in a JAR then you must include a reference to the JAR in your configuration.

    ARCHIVE=frmall.jar,audio.jar

    A URL cannot read into the contents of a JAR file. Using this configuration, your code would now look like this:

    PLAY_AUDIO('po.mp3');

    Alternatively, you can store the file on the server and access it using a URL. I do not recommend this method as Java may throw security warnings when trying to access it. However, if you wanted to try this save the mp3 file in the desired, virtually mapped directory then change your code to something like this:

    PLAY_AUDIO('http://srv-fm1:7777/forms/icons/po.mp3');

  • buggleboy007
    buggleboy007 Member Posts: 280 Bronze Badge
    edited Nov 16, 2020 10:09PM

    Hello Michael,

    I have really not understood this concept. If my DBA creates a jar file and then gives me the link saying : I have uploaded to srv-fm1 and also attached the file here. The file is accessible from /apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar

    The file that I gave him was 'po.mp3' but when he did the audio jar, he told me that the name was no po.mp3, but audio.jar.

    How do I access it using PLAY_AUDIO in WHEN-NEW-FORM-INSTANCE trigger?


    Also you mentioned :

    If the file is in a JAR then you must include a reference to the JAR in your configuration.

    ARCHIVE=frmall.jar,audio.jar

    Who should be doing this and where should this be done? Me as a developer in Oracle forms or DBA in formsweb.cfg file? Please let me know.

  • buggleboy007
    buggleboy007 Member Posts: 280 Bronze Badge
    edited Nov 17, 2020 11:28PM

    Hello Michael,

    Thanks for your assistance. My DBA told me that he has done all the above steps and when I launch the form nothing really happens:

    I then placed the following code components (one did not work, so tried another) in WHEN-NEW-FORM-INSTANCE. None worked.

    PLAY_AUDIO('po.mp3');
    play_audio('audio.jar');

    I am using forms :Forms [64 Bit] Version 12.2.1.0.0 (Production). Using the same form, if I call a music file from the internet it plays but not an mp3 file created locally.

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,815 Employee

    The hint is in the Java Console. Look carefully at the path shown in the console. It's telling you where Forms is looking for your file. In my example above, it is looking in the CODEBASE, which is /forms/java. If you put your JAR in the /forms/java directory then the file will be found. If the file was found you will also see in the Console that audio.jar was found and downloaded. If you do not see that audio.jar was downloaded then you can understand why things aren't working.

    The correct syntax for using a JAR is as I mentioned. All the other examples you shared would never work.

    Also, open the JAR file in WinZip, 7Zip, WinRaR, or any other Zip tool with a UI so you can visually see the structure. Carefully note if your file is in the root directory or in a subdirectory. Here is an example of three files in the root directory of a Zip file named demoMedia.jar


  • buggleboy007
    buggleboy007 Member Posts: 280 Bronze Badge

    Michael - I did download and unzip the contents of JAR file and here's how it looks. It appears that the po.mp3 is in root directory of 'audio' folder.


    Coming to the path of the file in Java Console, it looks like you need to copy the audio.jar file to Java folder, right? Based on what my DBA has said the path is: apps/retail/base/12c/icons on the server, or http://srv-fm1:7777/forms/icons/audio.jar

    Does this mean that he has not copied the JAR file to the JAVA folder? (I asked him this question but haven't heard yet).

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,815 Employee

    Yes. He put the file in the wrong place. As I mentioned, it must go in Oracle_Home/forms/java

    After copying there, WLS_FORMS must be stopped and restarted.

  • buggleboy007
    buggleboy007 Member Posts: 280 Bronze Badge
    edited Nov 18, 2020 5:29PM

    Hello Michael,

    One good news – The audio works. I tested it on a form that I prototyped on my home computer (which has Oracle forms : Version 12.2.1.4.0) and was able to reproduce the exact sound/voice of PO.MP3 file. 

    At work we are using (for exploring new features only) Version: 12.2.1.1.0. I do not know if the version is the root cause. Anyway here are the steps that I went through:

    • Copied the JAR file in ‘middleware/forms/java’ directory  (this is the same JAR file that my DBA used)

    • Then made a change in formsweb.cfg file i.e. added audio.jar file entry in the following locations where I found formsweb.cfg

    (E:\Middleware\user_projects\domains\base_domain\pending\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config)

    (E:\Middleware\user_projects\domains\base_domain\servers\WLS_FORMS\tmp\_WL_user\formsapp_12.2.1\wblalg\config)

    • Then shut down OHS, WLS_FORMS, Weblogic Admin Server and Node manager too.

    • Restarted my home computer

    • Then restarted Node Manager, Weblogic Admin Server, WLS_FORMS and finally OHS.

    • After everything settled down, I launched the form (that I had made the change).


    • When I pressed START button, I was to hear contents of the audio file. This proves your steps are working but not sure why in the office it is not.

    Thanks for all your assistance in this.

  • buggleboy007
    buggleboy007 Member Posts: 280 Bronze Badge
    edited Nov 18, 2020 6:02PM

    I tried reentering it through FMC UI itself to begin with. However after spending 30 minutes I gave up that option because I could not find a way for the same. Therefore went through backdoor method. I will go through the links that you have suggested to understand the way it needs to be changed from front-end itself. I completely agree not to change the entries from back-door method.


    @Michael Ferrante-Oracle : By any chance do you feel that lower version of Forms 12c is the root cause of the audio file not playing back? At home I have : 12.2.1.4.0. At work we have: 12.2.1.1.0