Main Menu


Sponsored Links

  


  
  

Tutorial - Playing Sounds

You can also play sounds in your cartoons. You should use function Play for this purpose. You should supply a path to a WAV file. This can be a WAV file from our library like "effects/gunshot.wav" or fully qualified path to a WAV file located online like http://www.webcartoonmaker.com/lib/sounds/effects/gunshot.wav or fully qualified path to a WAV file on your hard drive like "c:\\gunshot.wav". Please keep in mind that function Play does not change scene time. The length of a WAV file is unknown during compilation. You should use Sleep () command after this function call to change the time in scene:

void Scene1 ()
{
    Play ( "effects/gunshot.wav" );
    Sleep ( 1 );
}

There is a good set of 10 seconds long loops available in our library. You can use these loops as backgroud music in your cartoons. Here is an example of such usage:

#include <boy.h>

void Scene1 ()
{
    // some actions
    Boy Max;
    Max.SetVisible ();
    Max.SetPos ( 500,290 );
    Max.GoesTo ( -500, 290, 30 );

    // play music
    SetTime ( 0 );
    for ( int i=0; i<3; i++ )
    {
        Play ( "loops/adventurous_americana.wav" );
        Sleep ( 10 );
    }
}

Try to compile this example to see a boy walking and a music playing!

previous topic next topic

  
News

New Tales Animator Video by Alan Sturgess

Alan Sturgess shared an excellent video he made using Tales Animator! You can still download Tales Animator here. Unfortunately it is only available for Wi

...

Simple Online Character Designer

There is a prototype of simple online character designer available HERE. It is only a prototype, it does not contain many pieces yet but it can already generat

...

Book is updated

Now our book "Web Cartoon Maker: A Fun Way to Learn C++" is fully in synch with WCM 1.5! It is available for download and online reading HERE.

...

Web Cartoon Maker 1.5 is here!

Web Cartoon Maker 1.5 is finally here! You can download it HERE! Here is what was updated in version 1.5: Web Cartoon Maker Desktop Edition is now fully standal

...

read more news...


Poll