Catchsound

Linux specific forum
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Catchsound

Post 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?
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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.
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Could you test if CatchSound() is working on a regular IncludeBinary (without packing it) ? Also does LoadSound() works correctly at all ?
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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...
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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"
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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!
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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)
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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).
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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!
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post 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 :-)
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

And the debugger didn't complain about it ?
Post Reply