473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to run external softwares from within java code?

I want to know how can I execute external softwares from within my java code.Actually what my java code does is that it takes a voice input from user and converts it into a .wav file.Then it has to execute a external software that that takes two wav files and returns the percentage similiarity between them.
The part upto saving the user voice input as a .wav file is done.Now I need to know how can i get my code to :

(i) Start and run the software.
(ii)Make the two wav files available to the software for its execution.
(iii)Take the result (percentage similiarity) from the software and print it on the screen or save it in variable.

For me this is really complex so awaiting responese from all of you.

Thanks in advance.
Apr 17 '10 #1
4 1671
Fr33dan
57
If the other program is a command line program you can use the Runtime Class to create a Process object to run the program. Then fetch the results from process's the InputStream after it's been run.
Apr 17 '10 #2
Actually its not a command line program but a software downloaded from net.It has a specific GUI which takes two wav files and displays the percentage similiartiy between them.So how do I make this software run properly from within my java code?? please Help.
Apr 18 '10 #3
Fr33dan
57
Unfortunately that makes the task exponentially more difficult and I wouldn't know how to begin to do that. To be honest I'm not sure if that is possible for the Java interpreter to have that much control of the system but maybe someone else has some ideas?
Apr 18 '10 #4
jkmyoung
2,057 Expert 2GB
If the other program doesn't have an API to use with it, you're getting into the realm of automated testing/programming, which is much more complex. You have to really ask yourself at this point: is it worth programming this part of the program in?

If you still think it is, look up MouseClick events and the Robot class.
1. You have to ensure you can resize/move the program to the correct spot. I suggest forcing a maximize of the program.
2. The interface of the program can not change significantly; and very small things are now significant.
3. Save your .wav files to a set location on the computer every time, and have the other program load it from that same location, saving the results to a similar permanent result location.
Apr 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Apple | last post by:
Hi guys, I am working on my java cryptography assignment. I am looking for the popular or the best cryptography softwares either wrote in java or not to encrypt/decrypt files using DES/RSA...
3
by: Hal Vaughan | last post by:
I need to be able to run external commands from within a Java program, on Linux and Windows (and eventually OSX). Under most circumstances there is no problem, but if the path I specify as part of...
0
by: BRUCE WILLIS via DotNetMonster.com | last post by:
Hello architectural, engineer and technical users! We can offer you new regi stered CAD/CAM/CAE softwares: Survey , GIS , Rock , Soil and Water, Industri al and Control Project, Mathematics ,...
1
by: Martin_Hurst | last post by:
Is it possible to establish a connection from within a postgres database to another external database on the network, i.e., not a java or scripting connection, BUT by some type of table definition...
4
by: david | last post by:
I've been working on an external C module for Python in order to use some of the functionality from Ethereal. Right now I'm getting segfaults originating from within the Ethereal source code, but...
2
by: bpr | last post by:
hai everyone, My task is to list out softwares installed in client pc... My idea is to know command that fetch me the softwares installed in a particular pc..and then from a java application...
1
by: Lyndon | last post by:
Hi all, I am developing an Access database application that requires some additional, non-database related functionality. This additional functionality is essentially to validate a flat text...
1
Nepomuk
by: Nepomuk | last post by:
Hi! I'm trying to run an external Program with Process p = Runtime.getRuntime().exec("/bin/sh -c \"/bin/gzip -c /home/user/workspace/TarGz/pics.tar > pics.tar.gz\""); CleanStream cleanError =...
2
by: harika6 | last post by:
hi friends!! java program to retreive all softwares installed in the system as an output i.e all the softwares that are in add or remove programs.
1
by: rpm27 | last post by:
I was wondering what are some of the important softwares that are entirely or mostly written in Java. I heard that LimeWire is. Does someone know?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.