Slick Forums

Discuss the Slick 2D Library
It is currently Thu May 23, 2013 8:35 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Aug 20, 2011 6:59 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Soundly is a small library in development which extends slick-util's sound functionality.

Primary aims:
- Further control over individual OpenAL sources.
- Further control over the OpenAL listener: its position, orientation, etc.
- Management of OpenAL sources based on priority, distance from listener, etc.

Why manage sources?
When you play a sound with OpenAL (i.e. with Slick2D or LWJGL), the sound relies on a "source". Depending on the machine and platform, you are often limited to work with a low number of sources. (The iPhone, for example, generally supports 32 sources with OpenAL -- i.e. 32 simultaneous sounds.)

With a flurry of gunshots, musical elements, voice-overs, footsteps, environment sounds, etc. it's easy to start racking up the sources. And when we reach this limit (Slick2D defaults to 64 sources), there are no more sound that can be played -- at least not until some of the action dies down!

In most games, by the time we have that many sources playing at once, the user won't notice if we remove some of the superfluous sounds (e.g. bird chirps, footstep) to make way for something that might be more important (another gunshot, a speech element, etc).

In comes Soundly. You define the importance of a Sound and let the sound manager handle the rest -- sounds will be swapped out based on priority, distance from listener, etc.

(Note: Soundly is in VERY early stages, and is subject to change.)

Links
Home page:
http://code.google.com/p/slick-soundly/

Source:
http://slick-soundly.googlecode.com/svn ... undly/src/

Documentation:
http://code.google.com/p/slick-soundly/w/list



EDIT: Updated, completely refactored, removed superfluous interfaces, added "Mix" class for easy mixing of volumes/panning/etc., added the ability of groups within groups

EDIT2: This project is being put on hold for the time being.


Last edited by davedes on Thu May 17, 2012 8:27 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 21, 2011 10:54 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
sorry but webstart is not working, see here

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 21, 2011 4:41 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Oops, I meant to remove that from SVN.

Use the executable JARs if you want to try the examples without compiling.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2011 4:31 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
A lot of updates and refactoring:
Code:
- New code base; changed naming; no more superfluous interfaces
- SoundGroups can now be added to other SoundGroups
- "Mix" added for adjusting the volume/pitch/pan of a sound or group of sounds (e.g. to allow the user to adjust, say, "speech", "music" and "GUI" volumes independently).
- MOD and OGG streaming is now supported with XStreamingSound
- Sounds can be flagged as a 'music track' to be played in reserved sources (by default index 0)
- The engine can handle multiple music tracks; e.g. for cross-fading or layering musical score. Priority, layer, etc. still works with music tracks.
- a fade() method like the one in slick.Music has been added
- some general bugfixes/improvements
- new MusicTest to show off multiple music tracks and crossfading


Check out the wiki for details:
http://code.google.com/p/slick-soundly/ ... edFeatures


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2011 2:35 am 
Offline

Joined: Sun Jan 02, 2011 8:39 pm
Posts: 64
Do you have plans on including support for Slick2d LoadingList and DeferredResource loading of XSound?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2011 11:58 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Quote:
Do you have plans on including support for Slick2d LoadingList and DeferredResource loading of XSound?

Yep, definitely on my todo list. 8)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2011 5:50 pm 
Offline

Joined: Sun Aug 21, 2011 9:08 am
Posts: 8
This looks really nice, I think I can use this for music boxes or something :)

_________________
I like programming for fun. Money is good too.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2011 6:32 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
albireox wrote:
This looks really nice, I think I can use this for music boxes or something :)

Thanks.

I've been using this version of Soundly with some tests and it suits its purpose. However, I'd like to ultimately build Soundly into a LWJGL (rather than Slick-based) audio engine.

My ambitious todo list... Ultimately I would like to see this workable with Slick, JMonkeyEngine, etc.
Code:
- "sound definition" files: simple scripts to define a mix, sound or group
- deferred loading
- reverb, delay, highpass/lowpass, etc. through EFX
- remove the emphasis on "2D sounds", make it all 3D (better suited with LWJGL and "2D sounds" doesn't make sense anyways)
- support OpenAL listener orientation, attenuation, etc.
- basic ADSR envelopes (attack, decay, sustain, release)
- simple dynamic music support (start/end times, tempos, patterns)
- completely remove dependency on SoundStore (and in turn StreamSound, MODSound, NullAudio, etc.)




Edit: Been doing some more work on it.
I've reworked Soundly to use Paul Lamb's SoundSystem as a base instead of slick-util: this means you can pick and choose which libraries to use (LWJGL, JavaSound, JOAL) as well as which codecs (JOrbis, JOgg, Wav, IBXM). And while slick-util only supported OGG streaming, you can now stream with any supported codec.

It also opens the doors to reverb/lowpass/etc. on Mac OSX -- while EFX (OpenAL effects) is not supported, JavaSound should work fine.

I'm planning on using XML to parse sound definitions, it might look something like this:
Code:
<!-- Temporary sounds are not held in memory after they have finished playing -->
<Sound id="boom" ref="explosion.ogg" temporary="true">
    <mix>SFX_MIX</mix>
    <priority>0.9</priority>
    <level>SFX</level>
    <effects>
        <!--
            A chain of effects, triggered every time the sound is played and
            updated along with the sound.
        -->
       
        <!-- When played, randomize the volume and pitch between the two values. -->
        <fx.Random.Volume low="0.9" high="1.2" />
        <fx.Random.Pitch low="0.9" high="1.2" />
       
        <!-- Add a reverb effect to the sound -->
        <fx.Reverb size="100" wet="50" />
       
        <!--
             Pan the sound from left to right over 1000 ms
             Animate will also work on Volume/Reverb/Lowpass/Hipass/etc.
        -->
        <fx.Animate.Pan start="0.5" end="1.5" time="1000" />

        <!-- Have the sound fade out 1000 ms from the end. -->
        <fx.FadeOut time="1000" />
    </effects>
</Sound>


Top
 Profile  
 
PostPosted: Wed May 09, 2012 6:43 am 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
I'm not sure if you are still reading this but what happened to your Soundly library? It's not going to get any update or do you have the LWJGL version? I've started using this a few weeks ago and the features Soundly offer bring great improvement to my game.

So far, the library is working like a charm but are there any features left out uncompleted when you stopped developing or any thing to take care of if I were to keep using the library? like are there known issues?

sorry for lots of questions.

edit: forgot to say "thank you" for making Soundly :p


Top
 Profile  
 
PostPosted: Wed May 09, 2012 9:05 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
I would like to see more of this too :D I would even to it myself if I had more time (I pretty happy I could some time to learn TWL, checked 1 of 1000 Things on my "To-Learn"-List).

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Fri May 11, 2012 12:06 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Glad to hear Soundly is working out.

My last "update" ended up turning into a complete refactor, and now I'm planning to put it into a different library altogether (think Slick-Util but with modern OpenGL, a more powerful texture/audio API, and a sprite renderer). :P So I probably won't be updating Soundly. What features/updates are you looking for?

If you ever run into bugs with the current problem, I can probably help sort them out.


Top
 Profile  
 
PostPosted: Fri May 11, 2012 1:48 am 
Offline

Joined: Mon Feb 13, 2012 6:31 pm
Posts: 40
Looking forward to your new library, hope it can be used with slick xD

I haven't ran into any problem with Soundly so far, mainly I'm using it for playing ambient sounds and using distant radius feature and fading volume. Also planning to replace slick's Music class with Soundly for my game now. Was just wondering if there's any class you shouldn't be using or wanted to know if there were any known issues.

It's stable in my game so I guess I keep using it :)


Top
 Profile  
 
PostPosted: Fri May 11, 2012 4:09 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
elonoa wrote:
Looking forward to your new library, hope it can be used with slick xD

Nope, sorry. And the API/design is mainly "OpenGL-like" as opposed to "Java2D-like." Shaders, texture arrays, framebuffer objects, etc.

Quote:
I haven't ran into any problem with Soundly so far, mainly I'm using it for playing ambient sounds and using distant radius feature and fading volume. Also planning to replace slick's Music class with Soundly for my game now. Was just wondering if there's any class you shouldn't be using or wanted to know if there were any known issues.

It's stable in my game so I guess I keep using it :)

For the most part Soundly just relies on Slick for audio decoding and streaming, which means that any problems with Slick audio will also crop up in Soundly:
- OGG files less than 4KB will give errors (note: at that size you should use WAV)
- Can't stream anything other than OGG
- Seeking may not work
- Music is streamed on the same thread as your game, i.e. be weary of that and don't go crazy streaming more tracks than necessary

It was programmed as I was first learning OpenAL, and I used Slick's source as a reference (which admittedly was a poor idea). :P


Top
 Profile  
 
PostPosted: Fri May 11, 2012 9:25 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
What I'm looking for is the following:
  • Channels or what you discribed as SoundGroups. So I can put 2 ogg files together and play them fading on channel to make the music less aggressive
  • pitch, volume, speed and all the stuff you said
  • deffered loading
  • looping while streaming (I know you made that possible for me but in a nice API it would be awsome too I guess :D)

Sound is just really important to me. I'm a huge fan of dynamic music like in Jak II & III, SSX and the Zelda series :)

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Wed May 16, 2012 3:54 am 
Offline

Joined: Sun Jan 02, 2011 8:39 pm
Posts: 64
http://code.google.com/p/slick-soundly/ ... und_Groups


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group