Page 1 of 1

Catchsound

Posted: Sun Aug 14, 2005 11:26 pm
by Brujah
Hy out there,

I try to implement the packer routines into my game.
I successfully compacted all my graphics and sounds in one file.

The Graphics are working.

But I can't here any Sounds anymore.
The routine Catchsound gives me no errors back.

Should it be possible to put grafics and sounds in the same file?

Posted: Sun Aug 14, 2005 11:48 pm
by Brujah
I just created a seperate file for my sounds.
But this is also not working.

Should it be possible to compress sound?

Has anybody done this already?

I using the new beta version.

Posted: Mon Aug 15, 2005 2:51 pm
by Fred
Could you test if CatchSound() is working on a regular IncludeBinary (without packing it) ? Also does LoadSound() works correctly at all ?

Posted: Tue Aug 16, 2005 5:38 am
by Brujah
I don't understand how I create a file containing all the soundfiles in uncompressed form.
But loadsound basically works fine.
Maybe for the first version I have to use my old loadsounds routine...

Posted: Tue Aug 16, 2005 8:42 am
by Fred
I mean, just test CatchSound on one file, like this (to verify than the routine works correctly):

Code: Select all

CatchSound(0, ?My Sound)
PlaySound(0)
Delay(5000)

DataSection
  MySound:
    IncludeBinary "Sound.wav"

Posted: Tue Aug 16, 2005 9:41 pm
by Brujah
Okay I did the following:

If InitSound() = 0
else
print ("not working!")
EndIf

CatchSound(0, ?MySound)
PlaySound(0)
Delay(5000)

DataSection
MySound:
IncludeBinary "chaos.wav"


Its working perfectely!

Posted: Tue Aug 16, 2005 9:50 pm
by Brujah
And I tested Loadsound with ogg support too.
Working fine.

I did this:

If InitSound() = 0
else
print ("not working!")
EndIf

UseOGGSoundDecoder()
LoadSound(0,"chaos.ogg")
PlaySound(0)
Delay(5000)

Posted: Tue Aug 16, 2005 10:21 pm
by Fred
So it's probably the packer which has a problem. I will investigate, thank for your tests ! For now, you can still create a little routines to put all your sounds in one file if you want (with WriteLong() to write the length of the file, then WriteData() to write the sound etc. Uses ReadLong/ReadData() to read them back).

Posted: Wed Aug 17, 2005 3:20 am
by Brujah
I use my old routine to load the sounds now. In uncompressed form. But I can't hear anything still.
Maybe the packer right now messes up the memory?
(I still load my graphics with it)

I hope you find the bugs.
Everything else is working so far. Soon its time to release version 1.0.0 of my game!

Posted: Sat Aug 20, 2005 3:30 am
by Brujah
I finally found the error. I messed up the order of the initsound
and loadsound in my game.

Its working fine now!
So its not the error of your routine!!

I'm sorry!
But this in programming :-)

Posted: Sat Aug 20, 2005 11:57 am
by Fred
And the debugger didn't complain about it ?