Allegro播放声音程序,就是不发声
用DJGPP+Allegro编写了一人简单的播放wav文件的程序,就是不发声,确信硬件工作正常(BC编写的声音播放程序正常),请各位大虾指点。#include <allegro.h>
int main( void )
{
SAMPLE *boing;
allegro_init();
install_keyboard();
install_sound( DIGI_AUTODETECT,MIDI_AUTODETECT,NULL );
boing = load_sample( "tada.wav" );
if (boing!=NULL)
{
printf(" Playing \n");
play_sample( boing,255,128,1000,0 );
readkey();
destroy_sample( boing );
}
else
printf(" Error \n");
return 0;
}
END_OF_MAIN()
运行程序显示 Playing