//First go in and delete the sound in customSounds
deleteSoundFileByWaveString(selectedWaveString);
//Get the relevant wavestring from the internal scriptfile
VPKArchive vpk = new VPKArchive();
try
{
vpk.load(new File(this.vpkPath));
}
catch (IOException ex)
{
ex.printStackTrace();
}
String scriptDir = this.getScriptPathByHeroName(((NamedHero) currentDropdown.getSelectedItem()).getInternalName());
scriptDir = scriptDir.replace(Paths.get(installDir, "/dota/").toString(), "");
scriptDir = scriptDir.replace("\\", "/"); //Match internal forward slashes
scriptDir = scriptDir.substring(1); //Cut off leading slash
scriptDir = scriptDir.substring(0, scriptDir.lastIndexOf("/") + 1); //Cut off file extension
String scriptFileString = null;
byte[] bytes = null;
for (VPKEntry entry : vpk.getEntriesForDir(scriptDir))
{
if (entry.getName().contains("game_sounds_" + ((NamedHero) currentDropdown.getSelectedItem()).getInternalName()))
{
try
{