Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi All I have found two bugs or I do something wrong. First if I use ESOD_DIRECT_SOUND_8 and call getPlayPosition() in a thread after each 25000 it is starting from 0, why? if I use ESOD_WIN_MM on windows to use ISoundMixedOutputReceiver as callback the pointer on addSoundSourceFromFile(...) return a valid pointer, but if I call getAudioFormat() on the ISoundSource* it is crasing, why? I hope somebody can help or support me! Many thanks |
||||
|
About the 25000 play position wrap: Is your sound longer than 25 seconds? If it's not, it should be the correct value then. About the crash: are you grab()ing the ISoundSource* pointer to be sure it stays valid? Maybe your sound source has already been deleted in the meantime? |
||||
|
Hi Yes, the sound is longer than 6min... About the pointer I will try again this weekend, to find out some errors in the code. For me it is more the problem about the trust of the getPlayPosition() function. If i use the ESOD_WIN_MM than the function return always the right value. |
||||
|
Not sure either, seems to be a bug with the DirectSound driver. I think it works internally with microseconds, and maybe for long sounds, it gets overflown or similar. I'll have a look at that, but don't expect a fix for this soon, better use WinMM then instead. |
||||
|
HI thanks I have also a little problem to understand the type of getSampleData(). Is it a ik_u8 or ik_s16? The problem is getSampleDataSize() return the number of bytes independend of type, for this reaon it should be always a ik_u8. But if it is right why return the function a void*. I try the following to get the left channel, but it is crashing:
Can you please make a short example to support me. Many hanks Sascha |
||||
|
Hm, difficult to say. You are sure that x and y are at least of size nn? And n is set to FrameCount, I guess? |
||||
|
To get the data use something like this: void* data = (void*)m_soundSource->getSampleData(); int cc = GetChannelCount(); int tt = GetSampleDataSize()/cc; int k = 0; for ( int i = start ; i <tt; i+=cc ) { if ( ESF_U8 == m_streamFormat.SampleFormat ) { val = (double)((ik_u8*)data)[i]; val /= 256.0; } else { val = (double)((ik_s16*)data)[i]; val /= 32768.0; } x[k] = val; k++; } |
||||
|
By just looking at that, seems to be correct. But maybe I don't see the error. Stepping through it using a debugger should easily reveal the error, I guess. |
||||
|
sascha wrote: ... First if I use ESOD_DIRECT_SOUND_8 and call getPlayPosition() in a thread after each 25000 it is starting from 0, why? ... It's possible to get it working (by me each ~24343 ms)? I know with ESOD_WIN_MM works well, but i need ISoundEffectControl, too. |
||||
|
Ok, it works now, was my fault, sorry! E_STREAM_MODE was wrong initialized. |
||||
|
Hi, I'm facing the exact same issue. I've observed a noticeable difference in the way the volume of 3D sounds are being handled when using the WinMM backend (basically, the volume increase significantly when crossing the "minDistance" boundary, volume being surprisingly lower in the [0..minDistance] range). So ideally I would keep using the DirectSound8 backend. I'm still using 1.5, has this issue been fixed in the latest 1.6 release ? Thanks for any input ! |
||||
|
No, that's the same in 1.6, sorry. |
||||
|
OK understood, thanks for the reply. Any chance you'll be able to fix that issue at some point (I'm afraid we'll have to find a fix for that problem in our software and I would really like to avoid having to integrate another sound library to be honest :/) ? |
|