I don't know if this is the appropriate section or if i should put it under software so sorry if its wrong.
I am trying to get a list of instruments from the java sound library. I wrote the code and it did not return anything so i started searching the web to try to fix my code. I found a forum with someone having the same problem (personA). I attempted to run code that worked for someone who was trying to help personA (personB) and i got the same results as PersonA which was the same thing as my original code. PersonA fixed his problem by disabling java.exe in his system 32 folder (leaving it enabled in his program files) and it worked. I tried searching for "How to disable an exe" and it gave me a bunch of useless results. So my question is how can i disable java.exe but only in the system 32 folder?
heres the link to PersonA's problem: Java Sound - accessing list of supported instruments
8 replies to this topic
#1
Posted 26 October 2010 - 06:47 AM
|
|
|
#2
Posted 26 October 2010 - 06:57 AM
Looks like he just removed it, or rename it so you got a backup, and then ran the java updater which noticed missing files and gives you a clean "install"
#3
Posted 26 October 2010 - 07:40 AM
Thanks Oxano (wont let me rep you?)
I renamed it to JavaRenamed and ran the update and neither my code or the code that is confirmed to work are returning any results. I know the instruments are there because i used them on my simple midi maker. Can anyone think of another reason it is not returning the list?
Edit: updater put java.exe back into my sys32. I tried renaming without the updater and i also tried renaming the one in program files instead. neither worked
I renamed it to JavaRenamed and ran the update and neither my code or the code that is confirmed to work are returning any results. I know the instruments are there because i used them on my simple midi maker. Can anyone think of another reason it is not returning the list?
Edit: updater put java.exe back into my sys32. I tried renaming without the updater and i also tried renaming the one in program files instead. neither worked
#4
Posted 26 October 2010 - 08:18 AM
What if you rename it, don't update and run the code?
(After taking a closer look at the sun forum post, i noticed he says there are 2 java.exe files. And he must use the one in the program files/java/jdkxxx/bin folder for it to find the sounds. If the java.exe is available in the win32 folder, it may use that and not be able to find the sounds)
Edit: can you also make sure you have a folder
program files/java/jdk1.x.y.z/jre/lib/audio (containing soundbank.gm)
(After taking a closer look at the sun forum post, i noticed he says there are 2 java.exe files. And he must use the one in the program files/java/jdkxxx/bin folder for it to find the sounds. If the java.exe is available in the win32 folder, it may use that and not be able to find the sounds)
Edit: can you also make sure you have a folder
program files/java/jdk1.x.y.z/jre/lib/audio (containing soundbank.gm)
#5
Posted 26 October 2010 - 08:34 AM
right which is why i renamed the java.exe inside the system32 file (thats what that guy did to try and make it use the one in program files)
I have tried to rename and run without update and got the same result. I also tried renaming the one in the program files instead.
Thanks for the help, i have to turn off my computer we have a bad storm just came in and i don't want to rune my computer.
I have tried to rename and run without update and got the same result. I also tried renaming the one in the program files instead.
Thanks for the help, i have to turn off my computer we have a bad storm just came in and i don't want to rune my computer.
#6
Posted 26 October 2010 - 08:42 AM
This guy(InformIT: Making Waves with Java—An Adventure in Midi > Making Waves with Java—An Adventure in Midi) had the same and solved it by adding
Now, if i change the folder name of
C:\Program Files\Java\jdk1.6.0_21\jre\lib\audio
into audio2
It doesn't work with me anymore (pretty normal as that folder contains the soundbank)
Now, if it still doesn't work with you. I suggest you try the following where you manually point the synthesizer to the soundbank on your computer.
Soundbank bank = synth.getDefaultSoundbank(); synth.loadAllInstruments(bank);After the open. Like so:
Synthesizer synth = MidiSystem.getSynthesizer();
synth.open();
Soundbank bank = synth.getDefaultSoundbank();
synth.loadAllInstruments(bank);
Instrument[] orchestra = synth.getLoadedInstruments();
for (int i=0; i<orchestra.length; i++) {
System.out.println(orchestra[i]);
}
This also works with me. I'm not sure if it's bad for performance or not because you have them all loaded, and the "normal" way hasn't loaded them yet.. i think. (or maybe it loads by default)Now, if i change the folder name of
C:\Program Files\Java\jdk1.6.0_21\jre\lib\audio
into audio2
It doesn't work with me anymore (pretty normal as that folder contains the soundbank)
Now, if it still doesn't work with you. I suggest you try the following where you manually point the synthesizer to the soundbank on your computer.
Synthesizer synth = MidiSystem.getSynthesizer();
synth.open();
Soundbank bank = MidiSystem.getSoundbank(new File("C:\\Program Files\\Java\\jdk1.6.0_21\\jre\\lib\\audio2\\soundbank.gm"));
synth.loadAllInstruments(bank);
Instrument[] orchestra = synth.getLoadedInstruments();
for (int i=0; i<orchestra.length; i++) {
System.out.println(orchestra[i]);
}
#7
Posted 26 October 2010 - 08:47 AM
that was one short storm it hit, bent trees so that the tops touched the ground and was gone within 10 min. (^_^)
I just saw your edit sorry. I have the folder but it is empty.
Edit: Downloading the delux version of the file now. will update wether it works or not.
Edit2: It worked! 188 instruments wowzers! Thanks so much! It still wont let me rep you. I tried randomly reping lor to "spread rep around" and it still won't do it. sorry.
I just saw your edit sorry. I have the folder but it is empty.
Edit: Downloading the delux version of the file now. will update wether it works or not.
Edit2: It worked! 188 instruments wowzers! Thanks so much! It still wont let me rep you. I tried randomly reping lor to "spread rep around" and it still won't do it. sorry.
#8
Posted 26 October 2010 - 09:35 AM
No problem ;)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









