Mail Archives: djgpp/1999/07/17/00:55:55
From: | "Travis" <slardy AT erols DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Im not shure how to do sound
|
Date: | Fri, 16 Jul 1999 12:21:57 -0400
|
Lines: | 48
|
Message-ID: | <7mnmco$blq$1@autumn.news.rcn.net>
|
X-Trace: | tkDJfMk5Lc7XP225j6CRbLNlNooz0VO8VAvju770epQ=
|
X-Complaints-To: | abuse AT rcn DOT com
|
NNTP-Posting-Date: | 16 Jul 1999 16:24:56 GMT
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
X-Newsreader: | Microsoft Outlook Express 4.72.3110.1
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Im confused with using sound in my program here is the source that i wrote:
#include <iostream.h>
#include "allegro.h"
//Availible Res: 300x200, 640x480, 800x600, 1024x768, 1152x864
#define WIDTH 640
#define HEIGHT 480
#define PIC1 "omega.bmp"
#define SND1 "test.wav"
int main()
{
BITMAP *allegro;
PALLETE pal;
allegro_init();
install_keyboard();
set_gfx_mode(GFX_AUTODETECT, WIDTH, HEIGHT, 0, 0);
install_sound (DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);
// Load Bitmap Into Memory
allegro = load_bitmap(PIC1, pal);
set_palette(pal);
//Display Bitmap
blit(allegro, screen, 0, 0, 0, 0, WIDTH, HEIGHT);
readkey();
load_sample( SND1 );
play_sample(SND1 *, 255, 128, 1000, 0);
stop_sample(SND1 *);
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 -