3D Sound System

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

Previous topic - Next topic

paulscode

Weird, I can't find anything wrong with that second file you posted.  I have no idea why it has a screech at the end when played with CodecJOgg.  If you start having the same problem with other files, all I can suggest is to switch to CodecJOrbis or try another converter.

Disastorm

#391
did it have the screech for you as well when playing it with Sound System ?  I reconverted it again this time but i cut a little bit off the end and this time theres no screech.

btw off topic is there any way to download a javadoc from a webpage?  I've used some libraries (I believe this one also does not include a javadoc directory in the zip?) that don't have a downloadable javadoc so its annoying sometimes when programming with them.  Do I need to create a project with the source and then generate a javadoc manually?

Disastorm

hey i was just wondering does this work on android?

paulscode

#393
Not yet, but I have an Android version in the works.  It's not a simple port, because there isn't a good mixer built into the Java portion of Android, so I'm writing one in native code via the NDK.  The API interface will still be through Java, and will be virtually identical to the original SoundSystem.  I don't have a good estimation for a completion date, though - it is at least a month out (I had put it on hold for a while while working on other projects, but I recently came back to working on it again).

Disastorm

#394
Ah ok.  What do most people currently use to produce sound in android apps, do you know?  It looks like the android libraries have their own sound player called SoundPool or something ??

EgonOlsen

I'm using SoundPool, wrapped in a very small layer, my SoundManager-class. You can find it in the Alien Runner sources if needed, but it's really nothing fancy.

EgonOlsen

Just make sure to use ogg instead of mp3, because Android has some problems with loading mp3 files and just hangs (at least on 1.6, haven't tried newer versions in that respect).

Disastorm

alright thanks for the info.

AGP

I'm also hoping for an Android version. Question: does your sound system handle pitch-shifting? If not, that would be a very useful addition.

paulscode

Quote from: AGP on July 26, 2011, 08:07:36 PMdoes your sound system handle pitch-shifting? If not, that would be a very useful addition.
Yes it does.  Also has interface for doppler effect.

AGP

Very cool, thanks. When do you suppose you'll have the Android version available?

paulscode

#401
I'm back to working on this project again.  I should have a beta version out sometime next week.  The main thing is finding every optimization possible in the Java portions, like reusing Objects everywhere possible (my main library was a tad wasteful in this regard).

I'm playing around with an ObjectManager class which allows you to check out/in Objects based on their type from a hashmap of Object pools.  Still working out the kinks on this idea, though.

Other optimizations are moving most of the low-level process from Java into the native code, so there is less traffic passing between Java and native.  I've done a lot of this already, but there are still other improvements I can make on this as well.

AGP

As it happens I'm working on an Android project for which I need to do pitch-shifting, so I can't wait to try your Android version soon! Thanks again for your great work, Paul, you're a real credit to these boards.

Anyway, I tried writing a quick PC version, but your WAV plugin wouldn't open the WAV file I generated with Windows's Sound Recorder. What programs could I use to generate a Sound System-readable file?

paulscode

I haven't had a problem with CodecWAV before (although most people including myself are using the .ogg format).  What kind of behavior do you get (screeching, no audio, etc)?  Could you post a link to a broken .wav file so I can run some tests to see if there is anything obvious I can fix?

For editors, I mainly use Audacity (although admittedly don't think I've ever used it to create .wav files, so it may have the same issue).  The code for CodecWAV is quite simple, so I guess I just figured it was good to go after testing it on a few .wav files I had sitting around on my computer (assumptions do tend to get me into trouble ;D)

The initial release of SoundSystemAE will only have one codec (CodecTremolo, for .ogg files).  The reason for this is that I've redesigned the Codec and Library infrastructure in order to optimize performance on Android.  One of these optimizations was to give both the Library and Codec plug-ins a native component.  The two are linked by passing some integers through SoundSystemAE at startup.  These integers represent native function pointers.  Library and Codec reconstruct these pointers to communicate directly with each other at the native level, rather than sending buffers through the JNI to Java and then back through JNI to native (if you do any profiling on the ALAN demo I posted yesterday, you'll see how badly that affects performance).

That being said, the ICodec interface still has the "read()" and "readAll()" methods which are used by SoundSystemAE whenever a Codec doesn't have a native component.  So the PC version Codecs should be fairly easy to port over to the Android version (if you do that, though, you'd probably want to set the buffer sizes fairly high to reduce the amount of traffic moving from Java to native).

AGP

Thanks for the quick response. If you're running Windows, you can just use its built-in sound recorder. My file is just me saying "test" or something, but if you want it I'll send it to you.