Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Best way to compress music...  (Read 3426 times)

0 Members and 1 Guest are viewing this topic.

kaB00M

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Caffeware
    • Email
Best way to compress music...
« 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.



Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Best way to compress music...
« Reply #1 on: October 27, 2012, 06:58:20 pm »
Why don't you use the ogg/vorbis format?
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Best way to compress music...
« Reply #2 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kaB00M

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Caffeware
    • Email
Re: Best way to compress music...
« Reply #3 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.



Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Best way to compress music...
« Reply #4 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.
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Best way to compress music...
« Reply #5 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.
I use the latest build of SFML2

 

anything