delays in sound sdks, typical?

C05f8c500180fb7ccd99da97bf29505e
0
ulaoulao 101 Mar 30, 2009 at 03:50

Hi all, I’m currently programming in Irrlicht. I have never developed a game that required sound accuracy. This being my first shot at it, I find my self stumped. Yes I have asked the irrlicht board, only to find no answers. But the irlicht does not develop a sound engine in their core. So I have to use others. A few work well with irrlicht, audiere for example.

After reading on various boards I find this is a rather a common problem, but I see mainly unfinished threads. I did read that, audiere gives the least amount of latency, as one fellow stated. For me its about a second delay, and if that is the best I can get, I’m in trouble.

So a few question..

1) would anyone here agree that this is my fate or strongly disagree?

2) Is there a Sound SDK that anyone would recommend.

3) Is this the best a small budged game developer is to expect these days?

4 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Mar 30, 2009 at 05:51

Is what a common problem? You haven’t described in any detail what the problem is.

3c5be51fdeec526e1f232d6b68cc0954
0
Sol_HSA 119 Mar 30, 2009 at 06:05

If that’s a 1000ms delay from triggering a sound and hearing it, it’s a bit much. Have you set your sample rate high enough?

It’s been a while since I played with audio, but with some wince devices I remember that an audio buffer had to be pretty large to work - some 4kB or some such. At 8000Hz that means half a second, and with two buffers queued we get your 1000ms. Upping the sample rate to 48000Hz (which was the maximum for the device) the worst case latency dropped to about 166ms, which, while still bad, was at least tolerable.

I may remember the values wrong. But in any case, that’s one thing to look for. Also check if the playback buffer can be changed, and trim it down if possible. On linux devices we could get away with 256B buffer, for example, while windows devices required several kB.

Oh, and I recommend fmod, if you can afford it.

C05f8c500180fb7ccd99da97bf29505e
0
ulaoulao 101 Mar 30, 2009 at 16:46

I have not seen such setting but will look for them. FMOD is supported but I didnt realize it has a $$ on it. I’ll see what I can discover thx.

Is what a common problem? You haven’t described in any detail what the problem is.

Well the title “delays in sound” is the topic problem. and the details are not much to explain? Its a delay up to a second. What detail would you like to know? I’m going to look in to Sol_HSA’s suggestions.

update:: Ok this seems to help.

    int BytesToRead = 256 * sizeof(short);
    char* Buffer = new char[BytesToRead]; 
    SampleFormat SF = SF_S16; 
    m_pAudiereDevice->openBuffer(Buffer, 256, 1, 44100, SF); 
  • Not sure I did the buffer right, but its helping.

reference

virtual OutputStream* audiere::AudioDevice::openBuffer ( void * samples,
int frame_count,
int channel_count,
int sample_rate,
SampleFormat sample_format
) [pure virtual]

Ok scratch it all, IrrKlang is dead on !! Scratching Audiere, dont know why its delayed?

6aa952514ff4e5439df1e9e6d337b864
0
roel 101 Mar 31, 2009 at 08:26

Normal sound cards using DirectSound et. al. have delays and general. That’s why musicians prefer things like ASIO for their VSTs (kind of “software instruments”). But the normal delay is like 100ms or so, not 1000ms.