Forum Stats

  • 3,734,162 Users
  • 2,246,899 Discussions
  • 7,857,143 Comments

Discussions

Playing Audio - Forms 12c new features

buggleboy007
buggleboy007 Member Posts: 246 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

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,641 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: 246 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: 246 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,641 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: 246 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,641 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: 246 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: 246 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

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

    Here is how you get to the Forms configuration (assuming a single instance).

    '1. Go to http://server:7001/em (or whichever port you chose for Fusion Middleware Control) and login.

    '2. On the top left side, click on the hamburger button to expand the side panel. The tool tip will say "Target Navigation"

    '3. Expand the "Forms" node by clicking on the arrow to the left of "Forms".

    '4. Click on "forms1"

    '5. Then click on Web Configuration

    This is all explained in the Forms Deployment Guide (referred to as Working with Oracle Forms in v12.2.1.4)

    buggleboy007
  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge


    Thanks a lot once again Michael. I did follow the above steps and was able to view the UI of FMC. I did see the audio.jar entry in the archive text box.

  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge

    @Michael Ferrante-Oracle : A quick question regarding Audio:

    A) Let's say that my application consists of 300 Forms. Of those 300 Forms, I wish to have Audio play back capability in about 75 Forms. This means I will have to record 75 Audio files of .MP3 format.

    B) Then ensure that in those Forms I have to add the code: PLAY_AUDIO(<<NAME OF THE MP3 FILE>>);

    I guess my question is, can the names of those Audio Files be made dynamic or may be retrieved from a table rather than hard coding each audio file? Based on what I have noticed in the white paper + our conversation in this thread it appears to me that the name of the audio file(PLAY_AUDIO('1.MP3');) has to be mentioned in the Form(s) that needs the audio. It cannot be done dynamically.

    Is my understanding correct?

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

    Your understanding is incorrect.

    Nearly any value in Forms code can be created dynamically.

    In your case though, I do have a question. 75 audio files? Really? Although I'm very happy that you are finding this new feature useful, I am wondering what you might be doing with it...

    So to your question. Yes, you can store the audio file names in a table. To get them you might do something like this (exact code may need to be adapted - this is just an example):

    Declare
      v_audioName varchar2(100);
    Begin
      Select filename Into v_audioName From someTable Where <some condition>;
      If v_audioName Is Not Null Then
        Play_Audio (v_audioName);
      Else
        Message ('Audio file not found.');
      End if;
    End;
    

    There are other ways to do it, but again, this was just an example. You can also access the audio files from a URL.

    buggleboy007
  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge

    75 was just an example/hypothetical question. More than one for sure but do not know yet how many we require. I believe this is to make complex Forms (like Purchase Order, Material Allocation) have an audio playback so that the user knows the need/nature of the Form.

    Your example code was something on my mind too. It's good to know that it can be done dynamically.

    So concluding there are three ways to make it work:

    a) using the file name in PLAY_AUDIO built in

    b) passing a URL link in PLAY_AUDIO built in

    c) and then your example above

    Any other way that you think I have missed?

  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge

    Michael,

    My DBA at work put the 'audio.jar' file in FORMS/JAVA folder and applied the necessary changes. Yet when I launch the required Form which has PLAY_AUDIO('po.mp3') code, I still do not hear any audio playback.

    Is there a reason why? (i can get it to work on my home computer, Windows based using the same JAR file but not on office environment Linux based ).

    Here's how the office environment is set up:

    a) I log in to the office network remotely (via VPN due to work from home policy).

    b) Open the required Form and then add the necessary code and compile it successfully on Linux environment.

    c) Then open the executable but cannot hear any audio playback when I press 'Start' on the Form.

    Following screenshots should give you an idea if they are set up correctly or incorrectly.



    Please do let me know your thoughts on the above.

    Regards

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

    As I mentioned several times, the Java Console output will answer many of your troubleshooting questions. At minimum, the Console will give you a good hint as to why it's failing.

    If you are running with Java Web Start, it's failing because archive entries must be entered in "extensions.jnlp" and not the ARCHIVE parameter. Editing this file breaks the rules. To edit it, stop WLS_FORMS and open the file in a text editor. In the file you will see an example entry (commented out) for "jacob.jar". Create a new entry below that example using the same syntax (but without the comments). Replace jacob.jar with your jar name.

    Once the file has been updated, restart the managed server.

    If you are not using Web Start and are seeing this problem, I recommend reviewing the Java Console. It may be necessary to increase the logging level to Level 2. To do this, start the form then open the Java Console (or change the settings to make it open automatically). Once open, use the mouse and click in the Console text area to move focus to it. Then press the number "2" on the keyboard (above the letter Q). Do not use the number pad, as this will not work. If you did it correctly, you should see something like this:

    Now push the button or whatever it is you have to play the audio. Then note the output in the console.

  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge

    We are using Java Web Start. So based on what you have mentioned I will have to ask the DBA now to make changes in extensions.jnlp(ensuring that the audio.jar file is mentioned in extensions.jnlp and not in archive parameter).

    Unfortunately the Java Console does not give any error or hint (at the very least) for me to troubleshoot it independently.

    Anyways I will try what you have mentioned and then see the outcome.

  • buggleboy007
    buggleboy007 Member Posts: 246 Bronze Badge

    Finally Michael, based on what you mentioned(as we use JWS), my DBA implemented those steps and I was able to get the AUDIO to work. I was able to hear the contents of the audio file on our office environment.

    Thanks a lot for your assistance and guiding me all the way.

    I will let you and others know separately the new features of Forms 12c that we have implemented.

    Merci beaucoup!

Sign In or Register to comment.