New Dawn
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Latest topics
» The good, the bad, and the ugly
Sound Libary EmptySun Jun 20, 2010 7:45 pm by Admin

» Events are happing
Sound Libary EmptyWed Apr 14, 2010 11:29 pm by Admin

» Progress! . . .
Sound Libary EmptyFri Apr 09, 2010 5:10 pm by Admin

» Soulmen(jordan)
Sound Libary EmptyWed Feb 24, 2010 7:56 pm by soulmen

» Basic starting blocks
Sound Libary EmptyWed Feb 24, 2010 7:41 pm by Admin

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

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

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

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

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Sound Libary

Go down

Sound Libary Empty Sound Libary

Post by Admin 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 : 5632
Reputation : 3
Join date : 2009-07-16
Age : 34
Location : Wrexham, United Kingdom

https://spartanstudioforum.darkbb.com

Back to top Go down

Sound Libary Empty Re: Sound Libary

Post by Admin 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 : 5632
Reputation : 3
Join date : 2009-07-16
Age : 34
Location : Wrexham, United Kingdom

https://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