Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
vyst
Aug 25, 2009



Alright so we've got a Web app that was built Java. The main java-specific functionality is that it uses the "permission javax.sound.sampled.AudioPermission "record";" to store recordings done in a simulation through a user's PC input (microphone) onto a server that is then played back later as a review by their supervisor (superuser).

We hate java, or at least our currently programmed iteration of our java app. We hate the fact that users have to install edits to their java.policy to get it to function properly. So we're investigating starting from the ground up but maintaining the main functionality of "a user can go through a simulation, record their voice when prompted, this recording is then saved on the server for playback by a superuser later on".

-Interfaces with MySQL Database for login/reporting
-Browser agnostic (at least for the big 3 of Opera, IE, Firefox) support
-Can output PDF reports/CSV reports of user data
-Would love for users to not have to install additional things, but if they do hopefully something easily installable.
-Optional (tablet support)

I'm not sure which hot programming language these days would most effectively accommodate this project. Any guidance is welcome.

I apologize if this is the wrong place to ask. I rarely dip out of SH/SC and Tech Haus.

Adbot
ADBOT LOVES YOU

Lord Windy
Mar 26, 2010
I don't think they hate Java, I think the current App is a little inconvenient. However I am biased as Java is my language of choice.

Without knowing exactly how the thing is programmed, this is what the Oracle Documentation say about this:

quote:

Permission to Use Audio Resources

The Java Sound API includes an AudioPermission class that indicates what kinds of access an applet (or an application running with a security manager) can have to the sampled-audio system. Permission to record sound is controlled separately. This permission should be granted with care, to help prevent security risks such as unauthorized eavesdropping. By default, applets and applications are granted permissions as follows:

An applet running with the applet security manager can play, but not record, audio.
An application running with no security manager can both play and record audio.
An application running with the default security manager can play, but not record, audio.

In general, applets are run under the scrutiny of a security manager and aren't permitted to record sound. Applications, on the other hand, don't automatically install a security manager, and are able to record sound. (However, if the default security manager is invoked explicitly for an application, the application isn't permitted to record sound.)

Both applets and applications can record sound even when running with a security manager if they have been granted explicit permission to do so.

If your program doesn't have permission to record (or play) sound, an exception will be thrown when it attempts to open a line. There is nothing you can do about this in your program, other than to catch the exception and report the problem to the user, because permissions can't be changed through the API. (If they could, they would be pointless, because nothing would be secure!) Generally, permissions are set in one or more policy configuration files, which a user or system administrator can edit using a text editor or the Policy Tool program.

Look, I don't know much about this but why are users being asked to make the changes themselves? If the policy configuration files can be changed by a text editor why don't you write a small application that goes in and changes them for the user? Or if these computers are owned by the company shouldn't the computer janitors do this when they set a computer up? When I did Windows System Admin in a course, I made a Windows Custom install that automatically did things similar to this.

And for the Java JRE part, why don't you bundle the JRE with the application? (I know this is for a Mac, but I had it on hand and I didn't want to go find one for Windows and Linux).

I think this whole thing could be solved without having to remake an application.

EDIT: Just realized that it's a Web App so the bundling thing won't work.

Lord Windy fucked around with this message at 00:55 on Dec 5, 2014

MrMoo
Sep 14, 2000

It's running as an applet not via Web Start?

I would assume an amount of effort to move to HTML 5 as you need to move a lot server side.

Krotera
Jun 16, 2013

I AM INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
Some of the things you're specifying -- interfacing with mysql, for instance -- seem like server-only responsibilities. I don't think based on what you've said that you should have to rewrite your serverside component: am I mistaken?

I think (I'm not sure!) that you can do a lot of the things you're trying to do using HTML5's web audio api: that will probably be pretty platform-agnostic and shouldn't require extra installations beyond a web browser that implements the relevant standards. I don't know whether mobile-only browsers are generally stone-age or not, so you might check that, but they probably won't be. You would likely need to write a serverside adapter because HTML5 doesn't expose standard sockets as far as I know. (try WebSockets or other tricks involving requests that don't close)

Java is not necessarily a bad language for this, but applets are out of vogue (from what I'm told Java Web Start is currently preferred) and you might try transitioning to that. If worst comes to worst, you can probably write a standard desktop app and circumvent the problems.

Disclaimer: I don't really do webdev and the last language I did webdev in was Elm, which doesn't even expose the relevant libraries for your problem -- the only user-facing Java I've written lately has been small Swing/Seesaw apps and part of a game graphics engine for some friends. This is not my area of expertise!

roybot9000
Aug 27, 2003
I don't think you should specify a language at all. If you are going out to RFP for this maybe let any potential contractor/vendor come up with the technical solution based on your functional requirements.

Doctor w-rw-rw-
Jun 24, 2008
Are you able to tell us any more about the project? Specifying the language in this case might be counterproductive depending on the kinds of things you want to do. It would be good to know what your constraints/goals for the project are.

(If you don't want to explain it without membership in Goonwaffe, I'm covered on that front and have PMs)

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

MrMoo posted:

It's running as an applet not via Web Start?

I would assume an amount of effort to move to HTML 5 as you need to move a lot server side.

I would say this. There's a bunch of 'out of the box' clients like HDFVR and others that do this (I know this because I helped a startup 3 years ago develop a play/record application; we ended up using... ugh... Flash). The stats/management stuff isn't really an 'app', so there'd have to be some custom code there. You mention MySQL which probably means it'd be php. You could pair HDFVR with Wowza/Red5 media servers, but that might be overkill for audio-only less than 10 streams/minute type situations. Just saving the file on the server is pretty trivial if your guy knows RTMP.

vyst
Aug 25, 2009



I swear I didn't forget about this thread I just always read it on my phone and couldn't reply.

Here's how our software works at the basic levels-

The software is a voice-based simulation learning system. It's designed to simulate scenarios that customer service people would run into and help them properly approach them through correct examples. The software has a series of modes and for lack of a better term is a voice slide show.



Example - goes through the perfect conversation from start to finish based on the situation. It's an autoplay slide show that has audio and visuals on each slide to put it basically.
Practice - Only does the Customer side so you can practice (but not record) on your own your responses
Record - Allows you via an input on your PC to record your voice (the responses to the customer that you learned in example mode)
Review - Allows you to review these recordings and rerecord if necessary
Coach - This is usually just one slide with some "coaching tips" about the lesson

There's multiple user tiers a Admin > Super Coach > Coach > User (basically each higher level can manage the lower levels as your typical hierarchy works). Coaches can listen to their assigned users recordings and message them, view reports about their usage. Supercoaches can listen to coaches' users recordings, message coaches and users, etc.

Reporting needs to be robust - showing both session data and lesson data (what lessons, what modes, for how long, did they record, were the recordings reviewed by a coach) for users activity.

The real issue we have right now (other than the fact I'm not a Java programmer) is we're restricted by the requirement of an edit to the java.policy security file.

Right now in order for the software to allow for recording via a microphone we have to add a java.policy in the user's profile with the following information:
permission javax.sound.sampled.AudioPermission "record";
permission java.net.SocketPermission "www.URL.com:80","connect,resolve";


Now normally this is no big deal but a lot of users don't have admin rights to install exe's and right now our deployment mechanism for this installer is a rudimentary SFX with a batch file that creates the file and also adds the required
deployment.security.use.user.home.java.policy=true

to the deployment.properties file.

So I want to see if there's a way to avoid having to have the users deal with special parameters. Installing Java or Flash is fine- I can deal with "big name well known software" requirements, but we deal with so many different populations finding a way to streamline the exceptions would be incredibly useful.

Doctor w-rw-rw-
Jun 24, 2008
Go with Flash for the recording part. There are ready-made packages that basically do what you want, which are basically thin Flash wrappers that let you not worry about the actual recording APIs -
https://github.com/michalstocki/FlashWavRecorder
https://code.google.com/p/wami-recorder/

You just have to accept the permissions in the dialog Flash pops up, then you can record audio and send it to a server. Most of the web app should probably live on the server (probably), there doesn't seem to be much sense in making an applet these days. Going mostly HTML5 means that it should run (as a web app) on any platform you build it for, except for the recording implementation, which you should be able to swap out for different devices that do things differently.

If you want to save on the bandwidth and you can stand to let some of your clients use a little CPU, you could possibly encode the sounds files to mp3 (https://github.com/akrennmair/libmp3lame-js), though I wouldn't know how good an idea this would be. Probably best ignored until after you have something working end-to-end.

Googling brings up this useful page: http://stackoverflow.com/questions/19815442/how-to-record-audio-on-webpage-ios-android-pc-mac-no-flash

The server-side language can be anything, but if you've already got Java code that you plan to keep, then you can keep running it on whatever app server you've already got. Given a bit of flexibility, though, I'd specifically recommend building it on top of Dropwizard, or barring that, at least use Jersey for the backend part. Dropwizard makes it easy to deploy; after you build it you just drop a file on whatever computer is going to run the server and run java -jar whatever.jar, or something roughly that simple. Jersey (which Dropwizard uses as a component) makes building HTTP APIs pretty easy.

Honestly, though, given that your component that records audio works, the fastest path to getting something up and running once you have a browser uploading sound is to have or find a good dev and go with whatever they're comfortable with, within reason.

(Except node.js devs. Ew.)

Doctor w-rw-rw- fucked around with this message at 01:11 on Jan 13, 2015

Adbot
ADBOT LOVES YOU

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
Edit: oh sorry I didn't realize this was a thread for a specific question OP.

Knyteguy fucked around with this message at 18:58 on Jan 13, 2015

  • Locked thread