Latest topics
» The good, the bad, and the ugly
Sun Jun 20, 2010 7:45 pm by Admin

» Events are happing
Wed Apr 14, 2010 11:29 pm by Admin

» Progress! . . .
Fri Apr 09, 2010 5:10 pm by Admin

» Soulmen(jordan)
Wed Feb 24, 2010 7:56 pm by soulmen

» Basic starting blocks
Wed Feb 24, 2010 7:41 pm by Admin

» Okay so uni isn’t so demanding as I first thought.
Mon Oct 26, 2009 4:39 pm by Admin

» MP Architecture: Client/Server or Peer-2-Peer?
Sun Oct 04, 2009 2:34 pm by Daemn

» What I am working on at the Moment READ!
Fri Sep 25, 2009 5:15 pm by Admin

» Development Framework available at SourceForge
Tue Sep 22, 2009 9:46 am by Hairein

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Sound Libary

Go down

Sound Libary

Post by Admin on Fri Jul 24, 2009 4:28 pm

We need someone to write some code so we can play some sound in our game.

I was thinking of either using Fmod or OpenAL if any of you know how to play music via these libaries could you please post so here. If not any other libaries or suggestions are welcome

Admin

Admin
Admin
Admin

Posts : 105
Points : 3449
Reputation : 3
Join date : 2009-07-16
Age : 28
Location : Wrexham, United Kingdom

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Re: Sound Libary

Post by Admin on Mon Jul 27, 2009 12:21 pm

well I managed to get the game playing sound using SDL, problem is were limited to the use of .Wav files only


Code:
Mix_Music* music; //music object

  //start up sdl_mixer
  Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,0,4096);
  Mix_Chunk *sample; //load in the music
 
        sample=Mix_LoadWAV("filename.wav");
                               
        if(Mix_PlayChannel(-1, sample, -1)==-1)
        {
        //error
        }

      //Clean up
      Mix_FreeChunk(sample);
      sample=NULL;//make sure we free it
      Mix_CloseAudio();

Admin
Admin
Admin

Posts : 105
Points : 3449
Reputation : 3
Join date : 2009-07-16
Age : 28
Location : Wrexham, United Kingdom

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum