0
0

Hi brett,

we just found a conceptual problem with PCMREADCALLBACK and appropriate getPosition calls. If a application creates it’s sound through PCMREADCALLBACK and this creation stucks for some reason – fmod just plays the corrupted buffer and it increases the position. I tried to recalculate the position by hand but I just get it to pcm-buffer-level. The question is, is there any error code I can pass in this case?

I tried:
[code:2ttjt1rm]
FMOD_RESULT F_CALLBACK CPlayer::playstream( FMOD_SOUND *sound, void *data, unsigned int datalen )
{
return FMOD_ERR_MEMORY;
}
[/code:2ttjt1rm]

Unfortunetely, it doesn’t help.

Thanks and best regards
Slajar

  • You must to post comments
0
0

Hi,

probably I just found another getposition related problem. When I call

[code:1hc2zj14]
t_stream->setLoopPoints( start, FMOD_TIMEUNIT_MS, end, FMOD_TIMEUNIT_MS );
[/code:1hc2zj14]

(t_stream ist set to FMOD_SOFTWARE | FMOD_OPENUSER | FMOD_OPENONLY | FMOD_CREATESTREAM | FMOD_LOOP_NORMAL ) getposition returns a position that advances instantely. I have a workaround in my code right now that pretents to stop the position for the application but it might be an issue.

Personally, I would like to have a function that set’s the position to some value without flushing the buffers. The problem in my case is that I create additional samples while playing and the position becomes asynchronous and when I flush the buffers the sound stopps shortly. Maybe someone has an idea how to overcome this problem.

Best regards
slajar

  • You must to post comments
0
0

Hi brett,

thanks for your reply.
[quote:3v5kx8sm]Ok if your data fill routine gives an error, then fill the fmod callback with zeroes, dont just ignore the pointer. You can’t just fill fmod with data when you feel like it, you -must- give fmod something at that point. It is a data-pull model. You can’t just return an error, what would fmod do? It either fills with silence or -immediately- tries to refill the buffer by calling the callback again which doesnt sound like much use. [/quote:3v5kx8sm]

That’s ok. I do fill the buffer to avoid the clicking sound. But what do I do to prevent the internal position counter to stay at this position? I made somewhat of a hack. I play the same file silently in the background an there I can do channel->setPosition() without having the original stream flushed.

best regards
slajar

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.