Hi I was hoping you could lend some clarity in why I cant get this to play wav's and mp3's?
Its playing midi files fine but wav's and mp3's from free wav sites seem to not work(Just using for testing atm) Ive tried about 5 different wav's from different sites and a few different mp3's so far
Im currently using the SoundSystemJPCT implementation as i dont need the sound in 3d so much as just a library that can play lots of formats
This is how im using your library
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| public class Sound { SoundSystemJPCT soundSystem = new SoundSystemJPCT(); public static void main(String args[]) { Sound sound = new Sound(); } public Sound() { try { SoundSystemConfig.addLibrary( LibraryLWJGLOpenAL.class ); SoundSystemConfig.addLibrary( LibraryJavaSound.class ); SoundSystemConfig.setCodec( "wav", CodecWav.class ); SoundSystemConfig.setCodec( "ogg", CodecJOgg.class ); } catch( SoundSystemException e ) { System.err.println("error linking with the plug-ins" ); } String filename[] = {"wonderland.wav","blind.wav","T Bird - Diggin' in the Dirt.mp3"}; for(int i = 0; i < filename.length; i++) { soundSystem.newSource( "Source "+i, filename[i], false ); soundSystem.play( "Source "+i ); sleep( 10000 ); } soundSystem.cleanup(); } |
This is the output I get from the debug window
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Starting up SoundSystemJPCT... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http:OpenAL initialized.
Error in class 'CodecWav' Unsupported audio format in method 'initialize' ERROR MESSAGE: could not get audio input stream from input stream STACK TRACE: javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) paulscode.sound.codecs.CodecWav.initialize(CodecWav.java:128) paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392) paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640) paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800) paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415) paulscode.sound.CommandThread.run(CommandThread.java:121) Error in class 'CodecWav' Audio input stream null in method 'readAll' Error in class 'LibraryLWJGLOpenAL' Sound buffer null in method 'loadSound' Error in class 'LibraryLWJGLOpenAL' Source 'Source 0' was not created because an error occurred while loading wonderland.wav Error in class 'LibraryLWJGLOpenAL' Source 'Source 0' not found in method 'play' Error in class 'CodecWav' Unsupported audio format in method 'initialize' ERROR MESSAGE: could not get audio input stream from input stream STACK TRACE: javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) paulscode.sound.codecs.CodecWav.initialize(CodecWav.java:128) paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392) paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640) paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800) paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415) paulscode.sound.CommandThread.run(CommandThread.java:121) Error in class 'CodecWav' Audio input stream null in method 'readAll' Error in class 'LibraryLWJGLOpenAL' Sound buffer null in method 'loadSound' Error in class 'LibraryLWJGLOpenAL' Source 'Source 1' was not created because an error occurred while loading blind.wav Error in class 'LibraryLWJGLOpenAL' Source 'Source 1' not found in method 'play' Error in class 'LibraryLWJGLOpenAL' No codec found for file 'T Bird - Diggin' in the Dirt.mp3' in method 'loadSound' Error in class 'LibraryLWJGLOpenAL' Source 'Source 2' was not created because an error occurred while loading T Bird - Diggin' in the Dirt.mp3 Error in class 'LibraryLWJGLOpenAL' Source 'Source 2' not found in method 'play'
SoundSystemJPCT shutting down... Author: Paul Lamb, www.paulscode.com |
How do i use the other codecs that are commented out? they arent in import paulscode.sound.codecs to import
also what should i use for mp3's?