Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Adding sounds together

Credits go to CGamesPlay for helping out!
This thread is locked; no one can reply to it. rss feed Print
Adding sounds together
Kikaru
Member #7,616
August 2006
avatar

Hello. I am writing a game creation utility that supports custom sound. I'm trying to put all the samples into one file, when loading them from different files. Is there a function for adding a sound to the end of another one?

CGamesPlay
Member #2,559
July 2002
avatar

I recommend you use datafiles for this. But if you don't want to do that, you can just use packfiles. You will have separate sound files, but they will be in one physical file, divided up virtually. Check out:

There is no way to save the WAV to the packfile, you will have to open up the wav file and copy every byte into the packfile yourself. Easy to do, just ask.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Kikaru
Member #7,616
August 2006
avatar

I found functions for starting and stopping sounds at certain times, and I think I know how save samples, but what about adding the sounds together WITHIN the program?

CGamesPlay
Member #2,559
July 2002
avatar

So you mean playing two sounds at the same time?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Kikaru
Member #7,616
August 2006
avatar

No, I mean playing sounds one after another and having them in a single *SAMPLE object.

CGamesPlay
Member #2,559
July 2002
avatar

Open up sound recorder and paste the sounds one after the other :P If this is all you want to do, use any audio creator to make the sounds catenated.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Kikaru
Member #7,616
August 2006
avatar

OK. Well, thank you for your help! :)

Go to: