I am working on a speech recognition project, therefore I need to have audio files for more than thousands of words. I have done everything correctly in order to use Mbrola voices in FreeTTS but I can only use us1,us2,us3. It doesn't
recognize any other voices.
When I try to use mbrola_en1 I get this error:
Invalid Voice: Mbrola_en1
valid voices: alan kevin kevin16 mbrola_us1 mbrola_us2 mbrola_us3
I read all the questions related to this but unfortunately none of them are answered.
Does anyone know how to fix this issue?
The MbrolaVoiceDirectory class is hardcoded for us1, us2, us3. I copied the source code of the file to my own project, pointed the freetts.voices environment variable at it, and gently hacked it to look for the other filenames.
Related
It is possible to change the Users Music, Pictures etc Directory. For this, go to your Windows Explorer, Right-Click on "Music" and go to Path.
Here you can see, that I have my Music moved to an other hard disk.
Now the Question: How can I get this Directory in Java?
Because System.getProperty("user.home").concat("\\Music") leads to "C:\Users\GG\Music" and not to "D:\GG\Music".
UPDATE:
as answered by Anders:
The way that worked for me were the following 3 lines of code:
char[] pszPath = new char[WinDef.MAX_PATH];
Shell32.INSTANCE.SHGetFolderPath(null, ShlObj.CSIDL_MYMUSIC, null, ShlObj.SHGFP_TYPE_CURRENT, pszPath);
File f = new File(String.valueOf(pszPath).trim());
The correct way to get the path to special folders on Windows is to call a shell function like SHGetFolderPath with the CSIDL_* constants (CSIDL_MYMUSIC in your case).
You need to use JNI or JNA in Java to do this. Examples can be found here and here.
And for completeness, reading from the registry is not the correct way to do this...
As pointed out in the discussion beneath, the solution using the registry values isn´t good at all and will most likely not work. You shouldn´t read the registry as it is for storage of those values for windows only. A more programmable interface would be the shell where you can get the same info by typing SHGet*Folder*. This function is documented here
Thanks to #Anders and #IInspectable who mentioned this.
In the beginning I got this all wrong because the solution I suggested first worked on my PC, so I thought it would be alright. As it turned out this was only a coincidence.
I want to create an Executable Jar file that when run, checks the currently installed version of Java on that computer and displays it for the user. I have searched online but in vain, I cannot find any code that allows a Jar file to check. I know that the Java website has it ( http://www.java.com/en/download/installed.jsp) I can't find a way to replicate it in Java Code. Any help would be very much appreciated.
Note: Sorry if this question is really stupid and has a really simple answer... I just spent half an hour trying to find a solution and I couldn't so I need your help! Thanks
Edit: I don't need the code for displaying it, just to get the version is enough for me thanks!
System.getProperty("java.version");
Calling System.getProperty("java.version"); will give you version of the installed JRE which is what you want. Also take a look at other System properties, you may find some of them also useful.
I am running a program in java in which i use FreeTTS Voices, what i want is to change the voice.
when i run the program it shows:
"System property "mbrola.base" is undefined. Will not use MBROLA
voices."
I use the following code to speak up the text i want
Voice voice;
voice = voiceManager.getVoice(VOICENAME);
voice.allocate();
and then
voice.speak(t4.getText());
I tried to find tutorials to insert MBROLA voices. One of the tutorial i found was on their web page: http://freetts.sourceforge.net/mbrola/README.html but i am in windows not don't know anything of MAC therefore i am unable to know how to do it. Other tutorials were on Linux and i therefore even don't understand them. I am using netbeans on windows and i want someone to clearly explain me how to do this. I am a newbie and 14 year old.
If you look at the link you submitted, there's a big message that says: "NOTE: FreeTTS support for MBROLA on the Windows platform has been troublesome in the past, but appears to have been fixed by the MBROLA team. Please refer to the FreeTTS Forum for more information."
Here's a direct link to the forums: http://sourceforge.net/p/freetts/discussion/137669/thread/848a09ab
You have to specify the path to the mbrola folder, either by properties or directly via the code:
System.setProperty("mbrola.base", "c:/.../mbrola");
For more see e.g. FreeTTS mbrola not able to find path
I recently created a project in Netbeans using VirtualBox on which i installed windows XP (Not activiated)
My Windows required me to activate and would not allow me access to my files on the computer before i activate it, i stupidly went and uninstalled XP and reinstalled it, thinking i'll have access to all the files from the JAR file i created
I want to know if theres any way i can use the class files of the project i created, to create new java files so that i can edit the code in netbeans ??
Please if anyone can shed some light on this topic, if its at all posible to gain access to the forms java content i created. Im new to programming and this is something above my knowledge (i hope this makes sense)
If not possible please let me know what an absolute idiot i am, so that i can start re creating the project from scratch ... Sigh, and thank you
A jar/class file is compiled bytecode that is not human-readable... but with Java it is easily converted back. Look into a program like JavaDecompiler.1 This is not my program but I use it and I find it workable for my needs.
1 If this is considered spam I'll gladly invalidate the link.
As a sidenote: You are lucky that its Java. In many other languages like C++ that would hardly be possible. The difference is that Java does not compile the source code to machine code. That step is hardly reversible since for example all variable names are lost. Try to understand a non-trivial piece of code without helpful variable names...
Java instead compiles the source code to byte code which then is interpreted by Java on runtime. That byte cold holds way more information about the original source code than machine code.
I'm looking for some sample code to reference of a slideshow built in android. I was looking at these and they seem perfect but they only offer the .apk to download. I want to be able to download and see all of the file so i can learn from them. Can anyone help me find similar code or be able to read these?
http://code.google.com/p/android-slideshow/
http://code.google.com/p/android-slideshow-widget/
In the Google code link of your question: check the tab labelled 'Source' and use subversion to get code out the the repository.
Peter,
The source is provided: http://code.google.com/p/android-slideshow/source/browse/#svn%2Ftrunk
Alternatively, you can checkout a copy of the software using subversion. follow the instructions here: http://code.google.com/p/android-slideshow/source/checkout
go to checkout tag, path is given over there , copy that path and run it in your linux terminal.it will download the code for you.