PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Hekkus Sound System 0.97.5 released!

I have worked a few hours on my sound lib... only two new features but I think someone can find it userful :wink:

* added support for Microsoft ADPCM compressed mono WAVs.
* added SoundFX::maxplaybacks function to control the maximum number of times a sample can play back at once.

A little note on the ADPCM support: for now it only support it at loading time so hekkus don't play this WAVs in compressed form. When you load a compressed WAV the library decompress it and play it as a common 16 bit mono sample. I don't want to kill my engine performance :)

As always you can download it at http://www.shlzero.com
Fantastic! I was waiting for that (but of course you knew that :) )

I'll be downloading and integrating this version tonight, and I'll compress all my WAVs and let you know if I find any issues (I expect not to based on your fabulous work thus far).

Thanks gersen, I think I speak for everyone when I say thank you for Hekkus and all your hard work thus far!
One question I just thought of... Have you done any benchmarking to see how much of a performance hit it is to decompress the WAVs? I would expect there to be some difference, but probably not a really substantial one. Fortunately, as you've seen gersen, the way I architected my current game it won't be a problem since there's not up-front loading, but others may want to know, if you do.
Just dropped the new version in... Compressed my WAVs and I was good to go... Worked flawlessly, cut the WAVs down from a total of 109k to 56k. I couldn't be happier! :)
Thank you fzammetti for your words, I knew that you were waiting for this feature :)

I don't have beachmark this peace of code, of course load a compressed WAV is slower than load an uncompressed one but it shouldn't be so evident.
When I have some time I will made some test and post here the result.
Dave Johnston · 10 Aug 2003, 08:06 UTC
I'm thinking of wrapping up sound files in files, such that one file on-disk could contain 1 or more wav files. This file might even be compressed and/or contain other data.

Assuming in my code I can separate out the wav files into pointers to the data and a length of the data being pointed to, is there a feature in HSS that could read the data so I could play the sound?

i.e. SoundFX snd = GetSound(pPointerToWavData, iByteLength);

I looked briefly at the code but then I got scared, and ran away :)
Yes you can and it's not so difficult to do.

First create your own class for this one, somenthing like this

MySoundFX : public SoundFX {

public:
...
...

bool setData(char *wavdata, int bytelength, int frequency, ...);
};

On setData you have to initialize some SoundFX variables that are set on SoundFX::load(...) function. Since you don't want to call the standard load function on your MySoundFX you have to initialize it manually:

m_sample -> here you have to write the pointer to the raw wave data.
m_freq -> the frequency of the sample (11025, 22050, 16000, etc.)
m_length -> length in bytes of the wave data.

bool m_8bit -> the raw data are a 8bit uncompressed mono or a 16bit uncompressed mono sample? set true if 8bit or false if 16bit

bool m_delete -> set true if you want that the the lib perform a delete [] m_sample when your MySoundFX are destroied. Set false if you don't want.
Dave Johnston · 10 Aug 2003, 16:05 UTC
Gersen, you genius - thanks!