0
0

Hey guys i’m like about to kill myself, i dont know why i cant play any sound, song, or even mid files … Here’s the deal : i’m using Visual C++ 7
so :
i’v linked the project to fmodvc.lib
i’v include the header fmod.h

and this is my code for now :

include “headers.h”

include “fmod.h”

void intro(void)
{
//int count = 0;
//MIDI* midi;
FSOUND_Init(44100, 32, 0);
FMUSIC_MODULE* mintro;
mintro = FMUSIC_LoadSong(“start.mid”);
FMUSIC_PlaySong(mintro);
BITMAP** array = NULL;
array = new BITMAP*[2];
array[0] = load_bitmap(“introduction.bmp”, NULL);
array[1] = create_bitmap(640,480);
//midi = load_midi(“start.mid”);

double presy = 0.0;
//play_midi(midi, 0);
while (!key[KEY_SPACE])
{

    clear_to_color(array[1], makecol(0,255,0));
    if ( presy < 200 ) presy += 0.1;
    else {
    break;
    }
    draw_sprite(array[1],array[0],170 ,presy );
    blit(array[1],screen,0,0,0,0,640,480);

}

destroy_bitmap(array[0]);
destroy_bitmap(array[1]);
//destroy_midi(midi);
delete [] array;

}

( i’m using allegro … )
So i dont see where is the probleme … If somone could help me out i’ll be very glad ! Thanks

  • You must to post comments
0
0

what is the problem? does no sound play, does the program crash or just not compile?

  • You must to post comments
0
0

Right, iv forgot that part :)
The program compiles fine, and when the program starts, the screen freeze without any sound…

  • You must to post comments
0
0

maybe its because you are going around the drawing loop as fast as possible and therefore using all the cpu power

  • You must to post comments
0
0

[code:2z96xaaz]

include "headers.h"

include "fmod.h"

void intro(void)
{

FSOUND_Init(44100, 32, 0);
FMUSIC_MODULE* mintro;
mintro = FMUSIC_LoadSong("start.mid");
FMUSIC_PlaySong(mintro);

while (true) ; //idle loop

}
[/code:2z96xaaz]

try simplifying it to just this and then check what happens.

also, do a sanity check and make sure the file start.mid exists in the same directory as the executable.

  • You must to post comments
0
0

Thanks, I’v tried everything I could and i’m here now :

include “headers.h”

include “stdio.h”

include “fmod.h”

void intro(void)
{
if (!FSOUND_Init(44100, 32, 0))allegro_message(“Initiation probleme !\n%s\n”, allegro_error);
FMUSIC_MODULE* mintro;
if (!(mintro = FMUSIC_LoadSong(“start.mid”)))allegro_message(“Probleme here !\n%s\n”, allegro_error);
FMUSIC_PlaySong(mintro);
}

That’s all, i’v suppress the loop, and the allegro_message is quite like a message box … Or, when I launch it now it’s exactly the same it use to be ! Freezed black screen.
I’v tried this :

void intro(void)
{
if (!FSOUND_Init(44100, 32, 0))allegro_message(“Initiation probleme !\n%s\n”, allegro_error);
}

and no message box, it’s working here.
But I thing something is wrong with the second part, this one :
if (!(mintro = FMUSIC_LoadSong(“start.mid”)))allegro_message(“Probleme here !\n%s\n”, allegro_error);

I’v got no message box, but the screen freezes…
Note that i’m using VC++7. Thanks =)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.