Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - orange451

Pages: [1]
1
I will try adding a 10 ms of silence before each sound. Lets hope for the best! :)

2
Hello!

In my current Java project, I am attempting to load a sound file (.wav). This is how it is being done:
http://pastebin.com/z2WcbWq1

This works! And to execute a sound, I simply call:
Code: [Select]
soundSystem.quickPlay( false, soundName, false, 0, 0, 0, SoundSystemConfig.ATTENUATION_ROLLOFF, SoundSystemConfig.getDefaultRolloff() );
However this also produces some audible artifacts. Sometimes I hear a quick cracking sound (before/after the sound). What would cause this?

3
Programming / Re: [SoundSystem] Read sound data from bytebuffer.
« on: September 04, 2014, 09:08:08 PM »
Code: [Select]
// Get bytebuffer from the sound lump in the wad
ByteBuffer audioByteBuffer = lump.getRawLumpData().getByteBuffer();

// Create new byte array
byte[] audioBuffer = new byte[audioByteBuffer.remaining()];

// Fill byte array with wad buffer data
audioByteBuffer.get(audioBuffer);

// Flip the buffer for reading
audioByteBuffer.flip();

// Create Inputstream based on Bytebuffer
InputStream audioStream = new ByteBufferBackedInputStream(audioByteBuffer);

// Buffer the Inputstream
BufferedInputStream bufferedAudioStream = new BufferedInputStream(audioStream);

// Create AudioInputStream from BufferedInputStream
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(bufferedAudioStream);

// Send to sound system
soundSystem.rawDataStream(audioInputStream.getFormat(), false, "testSound", 0, 0, 0, SoundSystemConfig.ATTENUATION_ROLLOFF, SoundSystemConfig.getDefaultRolloff());
soundSystem.feedRawAudioData("testSound", audioBuffer);
soundSystem.activate("testSound");

The sound loads without problem (no errors). However, when I invoke: soundSystem.play("testSound"); I hear nothing.

4
Programming / [SoundSystem] Read sound data from bytebuffer.
« on: September 04, 2014, 12:04:25 PM »
Hello!
I am using Paul's sound system for my Java project. However, I do not want to be limited to just seperate flat files, and I would like to know if there is a way to load a sound from a bytebuffer, as I am using a packaged file format to store all my resources.

I sent Paul a PM about this a month ago :(

Pages: [1]