0
0

Hello,

I have a question.

To play sound with Fmod I use lock and unlock with a cyclic buffer(16 times the amount I will lock). if I use 8bit sound it sounds overmodulated (problem with lock and unlock with 8bit).
After this I tried 16bit audio. Now I have good quality, but no sound is played for a complete cycle. After this a complete cycle is played, and then a complete cycle isn’t played etc. etc.

The data is still locked and unlocked.

Does anybody now if this is a bug within Fmod, or does anybody know a solution???

Greetz,

Tim

  • You must to post comments
0
0

When you’re loading a sample by locking and unlocking the sound buffer, YOU are responsible of how the buffer is filled, when to start playing, etc, so it’s you, not Fmod, who must take care of correctly filling the buffer.
Don’t know exactly what could fail, but I suppose it’s about an uncorrect handling of the offset within the buffer and so not filling it correctly.
Luck 😉 !

  • You must to post comments
0
0

[quote:14x2etkd]
On 2001-05-07 09:48, Juantxo wrote:
When you’re loading a sample by locking and unlocking the sound buffer, YOU are responsible of how the buffer is filled, when to start playing, etc, so it’s you, not Fmod, who must take care of correctly filling the buffer.
[/quote:14x2etkd]

I agree with you, but If I take a look at my returnparameters they return a TRUE. This means that lock and unlock are functioning correctly. Even if I hear no sound the lock and unlock mechanism is succesfully.

Fmod is playing at that moment.

But perhaps you can see the problem in my code:

if (firsttime==1){

teller = FSOUND_GetCurrentPosition(0)
+BUFSIZE;

firsttime=0;
}

waardelock = FSOUND_Sample_Lock(samp1, teller, BUFSIZE, &aData1, &aData2, &aBytes1, &aBytes2);
if((int)waardelock==FALSE){
cout<<“lock was not succesfull”<<endl;
}
teller = (teller + BUFSIZE)%(8*BUFSIZE);

memcpy (aData1, Start->buffer, aBytes1);
if (aBytes2 != 0)
memcpy (aData2, ((Start->buffer)+(aBytes1)), aBytes2);

waardelock = FSOUND_Sample_Unlock(samp1, aData1, aData2, aBytes1, aBytes2);

if((int)waardelock==FALSE){
cout<<“unlock was not succesfull”<<endl;
}

Thank you and I hope you can help me

Greetz,

Tim

  • You must to post comments
0
0

[quote:5dxeohrm]
On 2001-05-08 16:51, brett wrote:
Are you scaling your data down to 8bits when you stream data into an 8bit FSOUND buffer? Also it could be that you have a signed/unsigned mixup .. try xor’ing the data with 128 if it is 8bit.
[/quote:5dxeohrm]

OK, I tried this and it works. So now I have a good playback with 8bit audio

[quote:5dxeohrm]
You are combining the return value from getcurrentposition which is in samples and lock which is in bytes .. this is wrong.
If a whole buffer of silence plays before you hear anything, then you must be filling data behind the playcursor, therefore it will not process anything until it does a complete loop.
[/quote:5dxeohrm]

OK, the getcurrentposition was wrong, but now I use 2getcurrentposition (16bit audio = 2bytes per sample)
The result stays the same. One cyclic buffer is not played after playing a cyclic buffer. As it is a cyclic buffer it is no problem if my write pointer is behind my playpointer(the latency will only increase). After one round I should hear the old sound I’ve recorded, but there is only silence.
Since I get a good playback when trying 8bit and I rewritten the code with 2
getcurrentposition I should get a good result.

Perhaps it is a problem with Fmod and Windows NT(98 has the same problem)?????

I’m all out of ideas.

Greetz,

Tim

  • You must to post comments
0
0

Much too occupied to take a look at the code, but sure it’s got nothing to do w/ W9x nor NT, ’cause I’ve worked with cyclic buffers (LOCK + UNLOCK) on those platforms using FMOD (and also w/ DSOUND, that works exactly the same) and they work great.

  • You must to post comments
0
0

[quote:2varnnil]
On 2001-05-09 05:45, Juantxo wrote:
Much too occupied to take a look at the code, but sure it’s got nothing to do w/ W9x nor NT, ’cause I’ve worked with cyclic buffers (LOCK + UNLOCK) on those platforms using FMOD (and also w/ DSOUND, that works exactly the same) and they work great.
[/quote:2varnnil]

Well, with small buffers (to have the smallest latency) and with 8 bit audio the playback is good. This I tried on a pentium3 833. If I try it to run on a Pentium1 233MMX the playback stutters. The same result I get when using Directx -> DirectSound. All these results are with Windows NT.

Can I ask for your systemconfiguration?

<font size=-1>[ This Message was edited by: Beidehand on 2001-05-09 23:36 ]</font>

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.