I copied the following code from sndtest. I am able to play the sound, but I
do not know how to deallocate the memory. Can someone please advise me what
I'd have to type to deallocate memory?
I see five things to deallocate:
soundbuf,snddata,sndstream,sndsource,sndsource3d
I just don't know what to type to deallocate them.
Thank you,
Jim
PS: I'm working on a whole new project now. I can't get peer to peer
communication to work when the peers are behind a NAT... So I decided to put
it off. It may be on permanent lay away. I'm thinking of making an
educational piece of software.
const char* fname = "/this/data/lesson1/1.wav";
csRef<iDataBuffer> soundbuf = VFS->ReadFile (fname);
if (!soundbuf)
{
printf("Can't load file '%s'! \n", fname);
exit(0);
}
csRef<iSndSysData> snddata = sndloader->LoadSound (soundbuf);
if (!snddata)
{
printf("Can't load sound '%s'! \n", fname);
exit(0);
}
csRef<iSndSysStream> sndstream = sndrenderer->CreateStream (snddata,
CS_SND3D_ABSOLUTE);
if (!sndstream)
{
printf("Can't create stream for '%s'!\n", fname);
exit(0);
}
sndsource = sndrenderer->CreateSource (sndstream);
if (!sndsource)
{
printf("Can't create source for '%s'!\n", fname);
exit(0);
}
sndsource3d = scfQueryInterface<iSndSysSourceSoftware3D> (sndsource);
sndsource3d->SetPosition (GetSoundPos (0));
sndsource3d->SetVolume (3.0f);
sndstream->Unpause ();
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]