Welcome, Guest. Please login or register. Did you miss your activation email?

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.


Topics - leiradel

Pages: [1]
1
Audio / Custom SoundStream
« on: November 17, 2015, 10:03:33 pm »
Hi All,

I'm trying to write my own sf::SoundStream but the application crashes with a floating point exception after onGetData is called 3 times.

I'm initializing the sound stream to 2 chanels at 22050 Hz, and filling the data chunk with 735 samples of silence. The rationale is:

22050 / 60 = 367.5 frames
367.5 * 2 channels = 735 samples

However, I'm receiving warnings and then the application crashes:

An internal OpenAL call failed in SoundStream.cpp (327) : AL_INVALID_VALUE, a numeric argument is out of range
An internal OpenAL call failed in SoundStream.cpp (327) : AL_INVALID_VALUE, a numeric argument is out of range
An internal OpenAL call failed in SoundStream.cpp (327) : AL_INVALID_VALUE, a numeric argument is out of range
Floating point exception

My methods are:

void initialize( unsigned sample_rate )
{
  SoundStream::initialize( 2, sample_rate );
}

bool onGetData( Chunk& data )
{
  static int16_t buffer[ 735 ] = { 0 };
  data.samples = buffer;
  data.sampleCount = sizeof( buffer ) / sizeof( buffer[ 0 ] );
  return true;
}

I'm not sure my numbers are correct. In fact, I find it odd that there are 735 samples in a chunk since the number of channels is 2, so I think the number of samples should be even...

Any thoughts? What size the buffer array should be? In SFML terminology, on a stereo stream, a sample is really just one sample, or it's two samples?

My SFML version is 2.1.

Thanks,

Andre

2
Feature requests / Stream classes
« on: September 24, 2009, 08:13:02 pm »
Hi,

One feature that I miss is a set of Stream classes much like SDL's SDL_RWops structure.

The problem is, I want to load resources directly from a package format. Right now I have to unpack the resource to disk or memory and then load it.

Thanks,

Andre

Pages: [1]