Posted June 5, 201213 yr I am trying to get my mod to register sound with it but I keep getting error to the console: C:\Users\****\Desktop\MCPs\mcp62_forge_updated\jars\mods\Psientic\psi\fx\swoosh.ogg true Error in class 'LibraryLWJGLOpenAL' No codec found for file 'swoosh.1' in method 'loadSound' Error in class 'LibraryLWJGLOpenAL' Source 'sound_1' was not created because an error occurred while loading swoosh.1 Error in class 'LibraryLWJGLOpenAL' Source 'sound_1' not found in method 'play' And as you can see from my code: package net.minecraft.src.psientic.mods.data; import java.io.File; import java.net.URL; import net.minecraft.src.SoundManager; import net.minecraft.src.mod_psientic; import net.minecraft.src.forge.adaptors.SoundHandlerAdaptor; public class CaveshroomSoundHandler extends SoundHandlerAdaptor{ public void onSetupAudio(SoundManager soundManager){ } public void onLoadSoundSettings(SoundManager soundManager){ URL resource = mod_psientic.getInstance().getClass().getResource("swoosh.ogg"); File file = new File("C:/Users/****/Desktop/MCPs/mcp62_forge_updated/jars/mods/Psientic/psi/fx/swoosh.ogg"); System.out.println(file + " " + file.exists()); soundManager.addSound("swoosh.1", file); soundManager.playSound("swoosh", 0, 0, 0, 1.0F, 1.0F); } } the file is in .ogg format which should be supported so I have no idea why it says that there is no codec for that. Here is the sound effect I tried to get to play. I know that it isn't wise to use absolute path for that file but it's just for testing purposes as I weren't able to find correct relative one. I will try to make that happen after ensuring it actually plays it.
June 5, 201213 yr because you're telling it that the file name is 'swoosh.1' '1' is a unknown codec, hence the error. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
June 5, 201213 yr Author because you're telling it that the file name is 'swoosh.1' '1' is a unknown codec, hence the error. Such a noob mistake.. I assumed that what comes after that dot is secondary "category" as in other sounds added to soundPoolSounds (First thing I did was to print what that contained and tried to copy that). Anyway thanks for helping... I will try to it. Edit: And it works! This topic can be locked now.
June 5, 201213 yr I'm also looking into how to create custom sound effects. Any tutorials out there on how to use the ISoundHandler? http://calclavia.com/uploads/banner.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.