0
0

Awesome work!

Will give this a spin as soon ASAP.

I’m really interested in getting the seamless stitching side and loading a new song as soon as the previous one finishes, so thanks for getting this callback stuff to work, you guys rock!

Cliff :)

  • You must to post comments
0
0

[quote="brett":9r5mpm94]Also you said ‘loading a song from a callback’ that would add a large gap i think. you should pre-open them and then just call play from the callback to remove loading time gap.[/quote:9r5mpm94]

Yeah, I didn’t really go into how I was going to implement, but yeah, I was going to do it the way you suggested ๐Ÿ˜€

I’ve disabled my code that I was using for FMOD 3, but there I was waiting till about 5 seconds before the end, telling fmod to load the sound, and then using the GetTime() to wait for the end of the song, and then playing the pre-loaded stream.

This was fine, except for the slight latency that would occur (on some machines, not all, depending). Using this callback, I’m hoping that the latency will reduced to nothing. Reason being, I have a couple of songs, that when played on a standard cd player, have no gap between, and it sounds terrible when there is even a slight stop of sound (after ripping the songs) ๐Ÿ˜‰

  • You must to post comments
0
0

Nothing fatal or anything, but I noticed that you included a workspace file, when you usually don’t…

playstream.dsw in the playstream example

might have just slipped in there ๐Ÿ˜‰

  • You must to post comments
0
0

I know docs are still under construction, but you mentioned in the release notes that there was more documentation (which I assume some might have been to do with the callbacks)…

Anyway, in the docs, under FMOD_CHANNEL_CALLBACK

It says:

[code:2nt5djnz]FMOD_RESULT FMOD_CHANNEL_CALLBACK(
FMOD_CHANNEL * channel,
FMOD_EVCALLBACK_TYPES event
);[/code:2nt5djnz]

NOTE: FMOD_EVCALLBACK_TYPES does not exist, and looking at the header, it looks like it should be FMOD_CHANNEL_CALLBACK_TYPE ??

Sorry, am posting as I find different issues :)

edit

Actually…the headers declare it as:

[code:2nt5djnz]typedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNEL_CALLBACK) (FMOD_CHANNEL *channel, unsigned int evdata, FMOD_CHANNEL_CALLBACK_TYPE type);[/code:2nt5djnz]

There is an extra param in there.

No worries if you havn’t got to updating the docs, but in case you have, and there was a bug with a script, ill let you know :)

  • You must to post comments
0
0

Initial testing of callback, seems to have problems.

I’ve modified the playstream example to test the callback.

For testing sake, i moved the variables for system, sound and channel to be global..

[code:1glfitu0]FMOD_SYSTEM *g_system;
FMOD_SOUND *g_sound;
FMOD_CHANNEL *g_channel = 0;[/code:1glfitu0]

and added the following callback

[code:1glfitu0]FMOD_RESULT F_CALLBACK end_of_file(FMOD_CHANNEL *i_channel, unsigned int evdata, FMOD_CHANNEL_CALLBACK_TYPE type)
{
FMOD_RESULT result = FMOD_System_PlaySound(g_system, FMOD_CHANNEL_FREE, g_sound, 0, &g_channel);
ERRCHECK(result);

return 0;

}[/code:1glfitu0]

(i used g_channel, rather than i_channel, as i thought something weird was going on)

I also changed (just before the main loop)

[code:1glfitu0] g_result = FMOD_System_PlaySound(g_system, FMOD_CHANNEL_FREE, g_sound, 0, &g_channel);
ERRCHECK(g_result);[/code:1glfitu0]

and added the SetCallback down the bottom.

[code:1glfitu0] g_result = FMOD_System_PlaySound(g_system, FMOD_CHANNEL_FREE, g_sound, 0, &g_channel);
ERRCHECK(g_result);

FMOD_Channel_SetCallback(g_channel, FMOD_CHANNEL_CALLBACK_END, 0, end_of_file);

[/code:1glfitu0]

The callback is working perfectly, in that the function gets called at the end, however the PlaySound call in the callback doesn’t seem to be working. The loop further down seems to be fine (playing = true), i just can’t hear anything.

I added another key in to do this within the main() loop,
[code:1glfitu0] case ‘3’ :
{
g_result = FMOD_System_PlaySound(g_system, FMOD_CHANNEL_FREE, g_sound, FALSE, &g_channel);
ERRCHECK(g_result);
break;
}[/code:1glfitu0]

and when pressing this it works fine (both in the middle of the song, and at the end, when the callback should have restarted it)

So at the moment, i’m suspecting that something is wrong with the callback.

Next I created a global flag called
[code:1glfitu0]BOOL g_playAgain = FALSE;[/code:1glfitu0]

and then in the callback, instead of calling PlaySound, I just set the flag to be TRUE.

next, in the main loop, I then do the following:
[code:1glfitu0] if (g_playAgain)
{
g_result = FMOD_System_PlaySound(g_system, FMOD_CHANNEL_FREE, g_sound, FALSE, &g_channel);
ERRCHECK(g_result);
g_playAgain = FALSE;
}[/code:1glfitu0]

and now when the end comes, it replays fine.

So. What’s going on? Am I doing something wrong, or can’t you replay a sound when you are in the callback function?

Cliff

  • You must to post comments
0
0

I am interested in seeing how easy it is to port my engine over to this new version of FMod and trying out the new features. But, darn it, I’m working on an IGF entry and v4 isn’t going to be out of alpha by then, so it’s going to have to wait. :( It’s looking really promising so far, though!

  • You must to post comments
0
0

[quote="brett":2hsv15o6]what are the main features missing holding you back?[/quote:2hsv15o6]
Well I was just under the impression that using it in a released product before it’s in beta wasn’t something you wanted us to do :) All I really use is panning, volume fades, ogg streaming/samples and (to a lesser extent) module playback right now.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.