0
0

As this is my first post, I’ll start with a thank you for the great sound engine.

Then to my current issue. I’m crossfading between two streams by doing a basic change in the volume of the channel. For some reason this does not work, but the first streams stays around playing in the background (it’s a looping ambient stream, the second stream is music). Both streams are allocated using FSOUND_FREE as channel num. It almost seems like the channel handle had been reference counted, but fmod doesn’t return any errors on changing the volume, it just ignores the call. The only other activity I have is the occasional sound effect, but nothing to fill up all the 32 channels. I’ve tried mute, pause, volume and all the associated functions and none of them work. On the other hand, if I allocate the channel number manually then everything is fine.

I’m using 3.74 on Win32. I would be happy to trace it, but I’m running a non-source commercial license. Thanks in advance for any help. :)

  • You must to post comments
0
0

Can you give a small example?
I can garanty you it’s possible to crossfade songs this way (just crossing volumes, don’t know if it’s possible using beat detection)

You can download a professional opensource player from my homepage:
http://www.ctuser.net (Section QPlayer).
It’s written in visual basic 6, so I doubt it’ll be easy understanding due it’s complexity.
Anyway, I’ve written a few lines to show how it works. (Sorry for my lack of C++ syntax knowledge)

Should be this way:

// Loading the song
PointerSong = FSOUND_Stream_Open(<Filename>, <Flags>, 0, 0)
If Pointer != 0
{
// Loading successfull, now Starting ‘playback’ with paused state
PointerChannel = FSOUND_Stream_PlayEx(FSOUND_Free, PointerSong, 0, 1)
If PointerChannel = 0
FSOUND_Stream_Close(PointerSong)
else
}
{
// Setting required volume, 255 for full volume, or 0 if you want to fade in later
FSOUND_SetVolume(PointerChannel, <Volume>)
// Now unpausing, so playback actually starts with correct volume
FSOUND_SetPaused(PointerChannel, 0)
}
}

Actually, you’ll have a pointer for the stream and the channel for EACH PLAYING/PAUSED SONG.
Change volume using the correct channel.

  • You must to post comments
0
0

Yep. That’s exactly what I did. But the channel handle does not respond to the volume control. And as the sound is still playing I’m assuming it’s not recycled by the reference counter either (that would shut down the sound wouldn’t it?).

[b:1ybe1h1j]No[/b:1ybe1h1j] functions work on the handle. Volume, mute, nothing. And this is only if a allocate the channel with FSOUND_FREE. If I pick a fixed channel everything works nicely. I’d love to get some error out of FSOUND, but all the functions give an OK return value. So I’m in limbo here, volume control doesn’t work and I get no feedback on why .. Without source I can’t trace it either .. :)

  • You must to post comments
0
0

Hm, maybe you can post exact source?
Have you tried the examples given with fmod api?

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.