I am trying to configure LIUM tool for speaker diarization. This question is a follow up of UnsupportedAudioFileException in LIUM Speaker Diarization
I have tried re sampling the file using sox and ffmpeg
I am new to any sorts of programming and i have followed all steps described in LIUM quick start guide and the above link. I still get the same error. I think my input file has issues related to header as mentioned by Nikolay Shmyrev in the above link however i have no clue on how to solve it.
My code is as below:
java –jar C:\Users\Ravi\Desktop\LIUM_SpkDiarization-8.4.1.jar \ --fInputMask= C:\Users\Ravi\Desktop\converted_f2.wav--sOutputMask= C:\Users\Ravi\Desktop\converted_converted_2.seg -–help --doCEClustering
Error:
10:52.037 SEVERE AudioFeatureSetFa FileNotFoundException
java.io.FileNotFoundException:
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.media.codec.audio.mp3.JS_MP3FileReader.getAudioFileFormat(JS_MP3FileReader.java:82)
at javax.sound.sampled.AudioSystem.getAudioFileFormat(Unknown Source)
at fr.lium.spkDiarization.libFeature.AudioFeatureSetFactory.getAudio(AudioFeatureSetFactory.java:162)
at fr.lium.spkDiarization.libFeature.AudioFeatureSetFactory.MakeFeature(AudioFeatureSetFactory.java:207)
The input file is at https://drive.google.com/file/d/0B7Fqe9EX5JbgT09BcXpSREd4em8/view?usp=sharing
Input File Name:converted_f2.wav
I have put the command and the full output of the prompt in a word document at
https://drive.google.com/file/d/0B7Fqe9EX5JbgUUl6THNCZFgxRnM/view?usp=sharing
The inpiut file has correct sampling rate and other parameters and thus i am not able to understand the cause of the error.
Thanks a lot for the help
Regards,
Ravi
File not found exception means the file is missing. Indeed you lack a space here:
--fInputMask= C:\Users\Ravi\Desktop\converted_f2.wav--sOutputMask= C:\Users\Ravi\Desktop\converted_converted_2.seg
You need a space before --sOutputMask
--fInputMask= C:\Users\Ravi\Desktop\converted_f2.wav --sOutputMask= C:\Users\Ravi\Desktop\converted_converted_2.seg
Otherwise it looks for a file called
C:\Users\Ravi\Desktop\converted_f2.wav--sOutputMask= C:\Users\Ravi\Desktop\converted_converted_2.seg which is obviously missing.
Overall, if computer says you that file is missing, it is really missing and you need to search for a reason. Most likely reason is your incorrect input.
Related
Note: This question was originally titled "How can I reset the path of FFMPEG in Java?" but, as it has been pointed out in the comments and the answer, the issue is not with Java, so I've changed the title to make it easier to find for others with the same issue.
I accidentally set the path for FFMPEG to a different folder, and I can't change it back.
I'm using Processing (the library and its IDE) and the user-created Video Export library to capture and write to an mp4 video file. The library required FFMPEG, so I downloaded and installed it. After I installed it, I ran the code, and the library called Java to request the path of FFMPEG. I wrongly set the path to a different folder (which I eventually deleted), and immediately realized my mistake. I ran the code again to see if I could trigger the prompt again to correct the path.
The console response I received was: (I'm sure most of it doesn't have to do with the actual issue. However, I wanted to show all of it in case it somehow does.)
Oct 24, 2016 10:23:25 PM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs
at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
java.io.IOException: Cannot run program
"C:...\Processing\Octree_Graphics\data\FFMPEG\ff-prompt.bat":
CreateProcess error=2, The system cannot find the file specified at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
com.hamoid.VideoExport.startFfmpeg(Unknown Source) at
com.hamoid.VideoExport.initialize(Unknown Source) at
com.hamoid.VideoExport.saveFrame(Unknown Source) at
Octree_Graphics.draw(Octree_Graphics.java:90) at
processing.core.PApplet.handleDraw(PApplet.java:2399) at
processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:731)
at
jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
at
jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
at
jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
at
jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at
com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
at
com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
at java.util.TimerThread.mainLoop(Timer.java:555) at
java.util.TimerThread.run(Timer.java:505) Caused by:
java.io.IOException: CreateProcess error=2, The system cannot find the
file specified at java.lang.ProcessImpl.create(Native Method) at
java.lang.ProcessImpl.(ProcessImpl.java:386) at
java.lang.ProcessImpl.start(ProcessImpl.java:137) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 17 more
VideoExport error: Ffmpeg failed. Study
C:...\Processing\Octree_Graphics\basic.mp4.txt for more details.
I need to find a way to reset the path of FFMPEG that Java has. I have tried uninstalling and reinstalling the library, but I haven't tried Java (I don't want to mess with anything it has in its current state).
Firstly, from what I can tell, this is merely inside the library in Processing, not inside of Java itself.
I have found you can reset the ffmpeg directory by running the
".forgetFfmpegPath();" method on the VideoExport object. You only need to run it once then you can remove it.
Inside the Video Export docs the method has the description "Makes the library forget about where the ffmpeg binary was located."
You can find the documentation of the method in the VideoExport documentation, which can be found in the Processing IDE at "Help -> Libraries Reference -> Video Export". (Note the VideoExport library must be installed)
I understand this is two years old, but I am here for other people who have this issue.
I just had this issue and found this question, but there was no answer, so I am giving the answer I found worked.
I was wondering if someone could help me find a good resource to help me fix this issue. I'm trying to create/save a batch file in the startups folder. Here's the general path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\startup_PMA_popup_check.bat
I've read a lot of things saying that I should simply elevate the privileges of my java program.
I read that if I was to make my jar file a windows executable, then the rights of the program are automatically elevated to admin privileges.
What you're seeing below is my jar turned into an exe and run. The error I got was the same error as the one I got from running my jar. I no longer think that the problem is simply giving my program admin privilege.
I performed a test outside of my program by going to this path and attempting to move a file into the folder. Assuming I'd have no issue "since I am root already", I went ahead expecting to get no prompts. What I got was a popup saying that I needed to confirm that I was Admin & to confirm that I wanted to put the batch file in the folder.
My question is how should I make my java program issue this prompt to the user or something so my program can continue & not crash like shown below??:
Exception in thread "main" java.io.FileNotFoundException:
C:\ProgramData\Microsoft\Windows\Start
Menu\Programs\StartUp\startup_PMA_popup_check.bat (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.PrintWriter.(Unknown Source)
at java.io.PrintWriter.(Unknown Source)
at prioritymanagementassistant.Background.createBatchFile(Background.java:106)
at prioritymanagementassistant.Main.main(Main.java:930)
Thank You for your time,
I am having Aparapi translating Java code to OpenCL. However I wonder how I can see the generated OpenCL code. The website says "by using adding -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true to your command line when you start your JVM". Being new to this technology, I am not sure how exactly you can do this? Can anyone please help by elaborating the process?
Added part:
Thank you. But what should I do in case of hadoop? I am trying to generate the OpneCL code for a hadoop program that I am running this way:
hadoop jar .java
I have tried adding -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true before and after jar word, both did not work. Here is what I got.
Exception in thread "main" java.io.IOException: Error opening job jar: -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true
at org.apache.hadoop.util.RunJar.main(RunJar.java:90)
Caused by: java.io.FileNotFoundException: -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:215)
at java.util.zip.ZipFile.(ZipFile.java:145)
at java.util.jar.JarFile.(JarFile.java:153)
at java.util.jar.JarFile.(JarFile.java:90)
at org.apache.hadoop.util.RunJar.main(RunJar.java:88)
Just add the property to the command line which you use to start java.
Specifically somewhere you have a command line like this
java -classpath yourpackage.YourApp
Just add the property like this
java -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true -classpath yourpackage.YourApp
I'm writing a java program for class that reads in from a txt file. I placed the text file in the package called Assignment3pckg and use a scanner like so:
Scanner s = new Scanner( new File("./src/Assignment3pckg/studentdata.txt") );
But it just keeps giving me
java.io.FileNotFoundException: .\src\Assignment3pckg\studentdata.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at Assignment3pckg.TestHW3.readStudentDataFromFile(TestHW3.java:25)
at Assignment3pckg.TestHW3.main(TestHW3.java:14)
Any insight would be greatly appreciated!
You are using a relative path (as opposed to an absolute path) for your file. Relative paths are resolved relative to the current working directory of the Java process when you run it.
Where this directory is depends on how you run Java.
You can find out by printing it:
System.out.println(new File(".").getAbsolutePath());
You can resolve it by:
Making your path relative to the correct directory
Using an absolute path (on Windows, that would start with C:\ or another drive letter)
Note though that in Java, you have to escape backslashes in a String. So C:\myproject\src\Assignment3pckg\studentdata.txt becomes "C:\\myproject\\src\\Assignment3pckg\\studentdata.txt" as a Java String. Or "C:/myproject/src/Assignment3pckg/studentdata.txt" as Windows doesn't mind forward slashes instead of backslashes either.
I received this source code: http://www.sbbic.org/split.zip under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
It came to me from the author without documentation or support (the author doesn't have the time right now, he is writing a book). My knowledge of Java is very limited.
Can someone tell me how to run the application in order to split the words in columns.txt file that is included in the source?
I've looked around in TextSegmenter.java trying to find how it should be called on the command line, but I have not been successful.
If I call: java com\whitemagicsoftware\dictionary\TextSegmenter lexicon.csv columns.txt
I get this error:
Exception in thread "main"
java.lang.NoClassDefFoundError:
com\whitemagicsoftwar
e\dictionary\TextSegmenter (wrong
name:
com/whitemagicsoftware/dictionary/TextSe
gmenter)
at java.lang.ClassLoader.defineClass1(Native
Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native
Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
I tried putting it into a .jar (again with limited experience, I only zipped the files with manually created manifest files included), but it is unable to load.
I am a newbee - sorry if this is a dumb question, but I would appreciate your help!
The purpose of the script is to break words that are joined (ex. "addresstype") into separate words (ex. "address" and "type"). The hope is to use this script in breaking words for the Khmer language which uses no spaces between words.
Thank you!
You are missing external libraries on the CLASSPATH. You have to set the CLASSPATH environment variable, or pass a classpath to the java command via the -cp option, like
java -cp externallib.jar:otherlib.jar -jar myjar.jar