Jump to content


delays in sound sdks, typical?


4 replies to this topic

#1 ulaoulao

    Member

  • Members
  • PipPip
  • 35 posts

Posted 30 March 2009 - 03:50 AM

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?

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5309 posts
  • LocationSanta Clara, CA

Posted 30 March 2009 - 05:51 AM

Is what a common problem? You haven't described in any detail what the problem is.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Sol_HSA

    Senior Member

  • Members
  • PipPipPipPip
  • 510 posts
  • LocationNowhere whenever

Posted 30 March 2009 - 06:05 AM

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.
http://iki.fi/sol - my schtuphh

#4 ulaoulao

    Member

  • Members
  • PipPip
  • 35 posts

Posted 30 March 2009 - 04:46 PM

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.

Quote

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

Quote

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?

#5 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 698 posts

Posted 31 March 2009 - 08:26 AM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users