delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/17/02:02:41

From: varobert AT colba DOT net
Message-Id: <3.0.32.19990717020145.007aee50@mail.colba.net>
X-Sender: varobert AT mail DOT colba DOT net
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Sat, 17 Jul 1999 02:01:53 -0400
To: djgpp AT delorie DOT com
Subject: Re: Im not shure how to do sound
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

At 12:21 PM 7/16/99 -0400, you wrote:
>Im confused with using sound in my program here is the source that i wrote:
> BITMAP *allegro;
          ^^^^^^^^ Is that allowed ?


>    // Load Bitmap Into Memory
> allegro = load_bitmap(PIC1, pal);
> set_palette(pal);
>
> //Display Bitmap
> blit(allegro, screen, 0, 0, 0, 0, WIDTH, HEIGHT);

Looks OK to me.

>
> readkey();
> load_sample( SND1 );
> play_sample(SND1 *, 255, 128, 1000, 0);
> stop_sample(SND1 *);
That;s your prblem; the code should look like this:

SAMPLE *mysample = load_sample(SND1);
play_sampe(mysample, 255, 128, 1000, 0);
//Do something so sample can finish playing
stop_sample(mysample);


> fade_out(3);
> destroy_bitmap(allegro);
>
> return 0;
>}
>
>
>can someone please tell me what is wrong? i want to get the sound to play at
>the end of the program after a key is pressed.  everything else works great
>
>
>
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019