Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / music not playing

Author
Message
cdiddy
15
Years of Service
User Offline
Joined: 16th Feb 2009
Location:
Posted: 16th Feb 2009 21:43
i am new to this as u will see from my basic code however for some unknown reason my music will not play. plz help

void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );

dbMaximizeWindow();

// switch to the media directory, load our world
// and turn lighting off
SetCurrentDirectory ( "media" );
dbLoadObject ( "universe.dbo", 1 );
dbSetObjectLight ( 1, 120 );
dbSetObjectCollisionToPolygons(1);

// load a model for our sky
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 5000, 5000, 5000 );
dbSetObjectCollisionOff(2);

// load music
dbLoadMusic("Jellyfsh.midi", 10);
dbSetMusicVolume(10,20);
dbPlayMusic(10);

// load and postion a gun
dbLoadObject ( "H-Tommy-Static.x", 10 );
dbRotateObject (10,-90,0,0);
dbPositionObject (10,10,-15,20);

// position the camera
dbPositionCamera ( 434, 42, -517 );
dbAutomaticCameraCollision(0,5,0);

// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;

int map_collision=0;

// our main loop
while ( LoopGDK ( ) )
{
// move the camera using the arrow keys and hide the mouse
dbControlCameraUsingArrowKeys ( 0, 3.0f, 3.0f );
dbHideMouse();

// create a rotation axis based on mouse movement and use the right/left keys to rotate
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.3f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.3f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbRightKey ( ) * 1.0f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbLeftKey ( ) * -1.0f );



// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );

// update the screen
dbSync ( );
}

// return back to windows
return;
}

nubs
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 16th Feb 2009 23:43
Is the file spelled right in the code? (Jellyfsh.midi)?
cdiddy
15
Years of Service
User Offline
Joined: 16th Feb 2009
Location:
Posted: 17th Feb 2009 04:26
yes i beilive so. for some reason the "i" in fish is missing. watever . plz help me.

nubs
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 17th Feb 2009 05:59
Not too sure but should that be jellyfish.mid
instead of jellyfish.midi

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 17th Feb 2009 06:01
SORRY > or rather jellyfsh.mid

All the midi files i load always use .mid NOT .midi

Hope this helps :- Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA
Comnik
15
Years of Service
User Offline
Joined: 16th Feb 2009
Location:
Posted: 17th Feb 2009 09:22
When I play Sounds in a Game,
i use:


But the Sound has to be WAV.

If this does'nt works, check the 'media' Dir. The Sound File has to be there...
cdiddy
15
Years of Service
User Offline
Joined: 16th Feb 2009
Location:
Posted: 17th Feb 2009 14:17
thanks guys for the help it was mid not midi

nubs

Login to post a reply

Server time is: 2024-09-30 17:31:07
Your offset time is: 2024-09-30 17:31:07