Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - thed

Pages: [1]
1
Audio / MinGW gcc Compile of C code on Windows
« on: August 12, 2008, 05:11:32 pm »
Thanks SirJulio.

I modified your suggested code to:

   while (sfPlaying)
     sfSleep(0.1f);

and it worked a treat. Many thanks.

2
Audio / MinGW gcc Compile of C code on Windows
« on: August 12, 2008, 01:14:22 pm »
Hello all. I have a simple source file (see below) to play an ogg file. Compiling with MinGW/MSYS on Windows XP using

gcc filename.c -o filename.exe -lcsfml-audio

or

gcc filename.c -o filename.exe -lcsfml-audio-d

appears to create the executable, however, when the executable is activated, a (command-prompt) window appears for an instant and then quickly disappears, with no sound being played and no error messages being displayed. The ogg file is located in the same location as the executable. When the ogg file referred to in the script is absent, I receive a "Failed to open 'absentfile.ogg' for reading" error message before the program shuts down. The SFML code i'm using is:

#include <SFML/Audio.h>

main()
 {
 
    sfMusic* Music;
             
     /* Load a music to play */
     Music = sfMusic_CreateFromFile("soundfile.ogg");
     
     /* Play the music */
     sfMusic_Play(Music);
 
     /* Cleanup resources */
     sfMusic_Destroy(Music);
       
 }

Any suggestions would be appreciated. Thanks.

Pages: [1]
anything