3D Sound System

Started by paulscode, March 11, 2008, 02:38:51 AM

Previous topic - Next topic

Disastorm

the file/path is correct, to make sure I even created a file object:


     soundSystem = new SoundSystemJPCT();

            File file = new File("scraping-ice-1.wav");
        soundSystem.quickPlay(file.getAbsolutePath(), false);


heres error:


Error in class 'LibraryLWJGLOpenAL'
    Unable to open file 'C:\Users\Disastorm\Documents\NetBeansProjects\ProjectDerby\scraping-ice-1.wav' in method 'loadSound'
Error in class 'LibraryLWJGLOpenAL'
    Sound buffer was not created for C:\Users\Disastorm\Documents\NetBeansProjects\ProjectDerby\scraping-ice-1.wav
Error in class 'LibraryLWJGLOpenAL'
    Source 'Source_-842624421_159493175' not found in method 'play'



if I use this xml to load it:



<!-- Add a couple of library plug-ins: -->
< addLibrary
className = paulscode.sound.libraries.LibraryLWJGLOpenAL />

< addLibrary
className = paulscode.sound.libraries.LibraryJavaSound />


<!-- Add some codec plug-ins: -->


< setCodec
extension = wav
className = paulscode.sound.codecs.CodecWav />

<!-- Instantiate the SoundSystem: -->
< create />


<!-- Load a clip into memory: -->
    < loadSound
        filename = scraping-ice-1.wav />


using


  try {

            soundSystem = new SoundSystemJPCT();
            File file = new File("Example.xml");
            SoundSystemLoader.loadXML(file.toURL(), soundSystem);
        } catch (MalformedURLException ex) {
            Logger.getLogger(SoundSystem.class.getName()).log(Level.SEVERE, null, ex);
        }
            File file = new File("scraping-ice-1.wav");
        soundSystem.quickPlay(file.getAbsolutePath(), false);


I get


Exception in thread "main" java.lang.NullPointerException
Error in class 'LibraryLWJGLOpenAL'
    Unable to open file 'scraping-ice-1.wav' in method 'loadSound'
        at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1591)
        at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1542)
        at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1520)
        at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1377)
        at game.sound.SoundSystem.main(SoundSystem.java:54)

paulscode

Quote from: Disastorm on March 31, 2011, 07:30:22 PMthe file/path is correct
...

Error in class 'LibraryLWJGLOpenAL'
    Unable to open file 'C:\Users\Disastorm\Documents\NetBeansProjects\ProjectDerby\scraping-ice-1.wav'
...

well...

Quote from: paulscode on March 27, 2011, 11:42:22 AM
If you are sure the path and file names are correct, the next thing to check is if you compiled the file into the JAR

Disastorm

even if i give the absolute path i need to put it in the jar?  I can't just run the project in netbeans?

paulscode

??  Absolute path implies that it is not in the jar, doesn't it?  If there is some reason you can't/won't compile your resource files in the jar, then why not use one of the methods that take an InputStream argument to load your files?  Also, there's no problem running from within Netbeans.

Disastorm

Hey I have this mp3 file that i converted to ogg and when i play it (im using backgroundmusic, havnt tried quickplay) right before it starts theres like a split second of a loud screeching sound.  Do you know how I can fix this?  I also tried converting it to wav instead but it still has that sound.

paulscode

Wow, I've definitely seen that before, but it's been a while (I'm still shuddering from the flashback I just got after reading your post :D ).  I don't recall off hand what the solution was for this.  Which library plug-in has the problem(or do they both?).  I can run some tests if you upload the file for me to grab.

Disastorm

its the one called Aftermath on this site: http://incompetech.com/m/c/royalty-free/index.html?genre=horror

the download is an mp3 but i converted it to ogg and wav and the screech occurs for both of them.

paulscode

#382
I can't reproduce the problem here.  What program are you using to convert the file?  Have you tried another program (such as Audacity)?  Please upload the actual ogg file you are having the problem with so I can see if there is something unique about that particular file's data that could be causing the weird behavior.

Quote from: paulscode on June 10, 2011, 09:00:39 PMWhich library plug-in has the problem(or do they both?)
You can get this from the Console output.  I assume you are using SoundSystemJPCT, but that doesn't tell me which library plug-in you are experiencing the problem for, because SoundSystemJPCT will either load the LWJGLOpenAL or JavaSound plug-in, depending on your OS and what components / drivers are installed.  Also, you might try using the CodecJOrbis plug-in to see if it also has the screeching behavior, since JOrbis has been around for a while and is well supported and more compatible than the JOgg codec plug-in which ships with SoundSystemJPCT.

--EDIT--
I decided to read back through this thread to figure out when it was that I experienced this screeching behavior before (3 years and 26 pages worth of history here).  I finally found it, but unfortunately, that earlier problem does not apply to your case, because it was related specifically to playing MIDI through a javascript interface I was working on at the time:
Quote from: paulscode on January 30, 2009, 05:02:16 AM...
4) I was having problems with loud scratching sounds in some browsers the first time a sound is played.  To compensate, I had to make the javascript automatically play a silent MIDI file when it starts up.  This is completely transparent, but you are required to place the file "silence.mid" wherever the javascript is located.
...

Disastorm

Audacity is already what I used.  here is the file: http://www.sendspace.com/file/6y42tr

This is the library: LWJGL OpenAL

paulscode

Thanks.  There is definitely something wrong with that file - the screech happens in every player that I played it in (including Audacity), so I don't think its a problem with the SoundSystem (although I haven't given CodecJOrbis a try yet, but I doubt it will fare any better than CodecJOgg).  What version of Audacity did you use to convert this file, and what OS are you running?  Also, does every file you convert have the screech problem, or just this one?

Give the file below a try and let me know if the screech is gone:
http://www.paulscode.com/downloads/Aftermath.ogg
(I exported it via Audacity 1.3.12-beta compiled on 64-bit Ubuntu Maverick)

Disastorm

#385
I'm not home right now so when I get home I'll try it.  However, I do know when i tried playing this file in vlc it played without the screech.  In any case, it may be because of an old Audacity version, I will try updating that.  I am on Windows 7 64bit

*edit that fixed it, turns out i was using the non-beta version which doesnt officially support windows 7.  I installed the beta version and it works.  Thanks.

paulscode

#386
You're right, it does play correctly in VLC.  It is definitely a file/ codec compatibility issue then (although I don't feel too bad about my library not handling this file since 90% of other players don't seem to either).  I haven't had a chance to try CodecJorbis yet, so you might try it since it is typically compatible with a lot more files than CodecJOgg is.

-edit- glad to see you got it working.  There was another issue with the last frame of audio data in ogg files created in older versions of Audacity, and I was able to adapt CodecJOrbis to handle it, so I'll probably tinker around with that file some more to see if I can figure out what the issue is with the data right there at the beginning (probably just the first frame).  It would be nice to brag that my library can handle files that most other programs cannot :)

Disastorm

#387
hey is there anything special u do to convert it with Audacity.  My converted file now has a screech at the end (or at least it plays around when the sound is going to loop again) instead of the beginning lol, however the one you uploaded does not have a screech anywhere.  However when i look at my ogg file in Audacity it does not have the screech anywhere.
heres my ogg: http://www.sendspace.com/file/crnxzp

paulscode

I didn't do anything special; just used whatever were the default settings.  I'll take a look at your file later to see if I can find anything useful about the audio data.  Do you get the same behavior if you use the CodecJOrbis plug-in?  Also, do you get the same behavior for every file you convert or just this one?

Disastorm

Quote from: paulscode on June 17, 2011, 12:23:49 PM
I didn't do anything special; just used whatever were the default settings.  I'll take a look at your file later to see if I can find anything useful about the audio data.  Do you get the same behavior if you use the CodecJOrbis plug-in?  Also, do you get the same behavior for every file you convert or just this one?

Well I just converted some random mp3 I found on my pc to ogg and it didnt have a screech anywhere, so it might just be that file.