SFML community forums

Help => Audio => Topic started by: kaB00M on October 27, 2012, 06:50:12 pm

Title: Best way to compress music...
Post by: kaB00M on October 27, 2012, 06:50:12 pm
I know this is not a direct SFML question, but I was wondering what is the best way to compress music.
Files of type .wav can be extremely large and openal32  doesn't play .mid,  for example.
 
Also, I notice that some projects don't even include the music as a different .wav file. It seems they include the audio in a .dat file along with the graphics. How is this possible?

Thank You.
Title: Re: Best way to compress music...
Post by: Laurent on October 27, 2012, 06:58:20 pm
Why don't you use the ogg/vorbis format?
Title: Re: Best way to compress music...
Post by: eXpl0it3r on October 27, 2012, 07:40:37 pm
Also, I notice that some projects don't even include the music as a different .wav file. It seems they include the audio in a .dat file along with the graphics. How is this possible?
They somehow pack it. A common way is to use zlib and decompress the contained data at runtime. There are even some libraries that can 'stream' it directly from the zipped file.
Others might have defined their own packing 'protocol' and then wrote a loader for it.
Title: Re: Best way to compress music...
Post by: kaB00M on October 27, 2012, 08:50:11 pm
Why don't you use the ogg/vorbis format?

Oh. ??? I was under the impression that .ogg files where for short sound snippets, not music. Thanks for the help! :)

Quote

They somehow pack it. A common way is to use zlib and decompress the contained data at runtime. There are even some libraries that can 'stream' it directly from the zipped file.
Others might have defined their own packing 'protocol' and then wrote a loader for it.


Interesting.

Thank you all.
Title: Re: Best way to compress music...
Post by: Laurent on October 27, 2012, 08:55:41 pm
Quote
I was under the impression that .ogg files where for short sound snippets, not music.
This is exactly the contrary, they are for musics and not for short sounds.
Title: Re: Best way to compress music...
Post by: OniLinkPlus on October 27, 2012, 10:47:52 pm
Why don't you use the ogg/vorbis format?

Oh. ??? I was under the impression that .ogg files where for short sound snippets, not music. Thanks for the help! :)

That's the exact opposite of what they're for. OGG is for music and longer samples, WAV is for short samples like sound effects.