LOADSOUND with compressed Soundfiles

Previous topic - Next topic

S. P. Gardebiter

I really need this. Having a bunch of 2 MB wav files, just because I would like to play some ambient sounds for the atmosphere isn't funny guys :/
~ Cave Story rules! ~

Ian Price

Can you not convert them to .ogg or .mp3?
I came. I saw. I played.

S. P. Gardebiter

Quote from: Ian Price on 2010-Jun-05
Can you not convert them to .ogg or .mp3?

That's what I want to do but I read in the help file that GLBasic is not able to use .mp3's for sounds. (Only for music.)
~ Cave Story rules! ~

Ian Price

Ah, right. You want them to literally play as sounds - that'll teach me for not reading the title properly.

I can't test .ogg on my laptop (they don't play with GLB), but you appear to be correct - you can't play .MP3s with PLAYSOUND.

I could have sworn .OGG files worked for sound (on my Wiz & GP2X), but I'm not so sure now. :S


GLB's sound really is a pain at times. Perhaps it's time Gernot looked at alternative sound systems.
I came. I saw. I played.

Kitty Hello

what program did you use to convert to ogg, Ian?

Ian Price

Quotewhat program did you use to convert to ogg, Ian?
Audacity for the most part,  although I have tried other converters.

I used to be able to play .ogg files on my main desktop (but I don;t use that anymore due to reliability issues), but both my laptops fail to play .ogg files from GLB - and this has been repeated by others too.

.ogg files work (with PLAYMUSIC) with GP2X and Wiz though, which tbh is where I need them to work anyway.
I came. I saw. I played.

S. P. Gardebiter

So what about playing compressed soundfiles with LOADSOUND? o:
Is it atleast on the todo list?
~ Cave Story rules! ~

Kitty Hello

no. I don't see any need for that and it's definitely not doable x-platform for me.

S. P. Gardebiter

#8
Quote from: Kitty Hello on 2010-Jun-08
no. I don't see any need for that

Why? I already explained it o: I want to play some ambient sounds and they may overlap. Games need atmosphere. If I use wavs they are 2 MB big but if I use MP3s they are only 200 kB big. It would be insane if I only would use 15 of them (30 MB versus 3 MB and 15 wouldn't be much soundfiles). My internet connection will die and my beta testers will complain about the huge download.
Also MP3 is a very common format, more common than wav. Why is there no need for this and why does PLAYMUSIC support MP3s and PLAYSOUND does not?

Quote from: Kitty Hello on 2010-Jun-08and it's definitely not doable x-platform for me.

There are several ways to implement this:
You could decode the MP3 and save it as a wav on the harddisk and then you could play it. Or you could decode it and load it into the ram. Should work for any platform. Decoding MP3s shouldn't be that hard. I would even code it, if you want.
~ Cave Story rules! ~

Ian Price

Can't you just play them as music using the PLAYMUSIC command,  or is there music playing as well?
I came. I saw. I played.

S. P. Gardebiter

Quote from: Ian Price on 2010-Jun-09
Can't you just play them as music using the PLAYMUSIC command,  or is there music playing as well?

Please read my posts:

Quote from: S. P. Gardebiter on 2010-Jun-09Why? I already explained it o: I want to play some ambient sounds and they may overlap.

But sometimes there is music playing as well.

I don't get whats so hard to get MP3 support working for Sounds. It's working with music too.
~ Cave Story rules! ~

Ian Price

Sorry. I did read that when you first posted - but I've worked and slept a little since then :/
I came. I saw. I played.

Kitty Hello

If it's about compression, uncompress them yourself from mp3 to wav at first start.
Really, I wish I could help you, but I don't see a x-platform way to do it. And I don't have a week holidays just for this. You might try the fmod or bass dll if it's windows/linux/mac only.

S. P. Gardebiter

I just thought that it should be in GLBasic, since I it's so common, I can't even believe that it's not supported. The problem with uncompression is always the file format. I will see what I can do, I just hope that it's not too slow if I uncompress them with GLBasic rather than INLINE C. If I'm able to uncompress them, I will make the functions to do so public.

Quote from: Kitty Hello on 2010-Jun-09You might try the fmod or bass dll if it's windows/linux/mac only.

The problem with 3rd party libaries is usually the license.
~ Cave Story rules! ~

Kitty Hello

Don't uncompress in real time - make that at the start of the game or so...