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

Author Topic: Slow music loading  (Read 8918 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Slow music loading
« Reply #15 on: October 29, 2012, 08:12:08 am »
I've created a task on the tracker:
https://github.com/SFML/SFML/issues/310
Laurent Gomila - SFML developer

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: Slow music loading
« Reply #16 on: October 29, 2012, 09:28:13 am »
What is the reason why int16 is used instead of float?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Slow music loading
« Reply #17 on: October 29, 2012, 09:33:55 am »
Quote
What is the reason why int16 is used instead of float?
It is the most standard and widely supported format. It takes half less memory than float. And it's probably easier to work with.

Oh, and float format is an extension, it's not available in the OpenAL core API. So its not guaranteed to be supported everywhere.
« Last Edit: October 29, 2012, 09:47:27 am by Laurent »
Laurent Gomila - SFML developer

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Slow music loading
« Reply #18 on: December 17, 2012, 07:47:28 pm »
Was the change ever reverted? It doesn't seem so to me.

I just noticed that opening a music (ogg) from a stream took AGES (it's 15.8 MB in size, takes about 7 seconds to load). I analyzed it, and indeed the whole stream is being iterated over before "openFromStream" is done and the application continues. This practically nullifies the "instant play" advantage that streaming offers.

While cracking .ogg files are something a developer can fix if he informs himself about the supported formats, people who are not affected by that issue now suffer from immense loading times. Besides, you only need to "fix" / convert your .ogg file once to resolve the issue for good, but the way it is now everyone needs to wait every single time the application starts. I think a bit of responsibility can be left to those who opt to use .ogg files. This is definitely not worth the cost.
JSFML - The Java binding to SFML.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Slow music loading
« Reply #19 on: December 17, 2012, 07:54:06 pm »
I completely agree with above.
Back to C++ gamedev with SFML in May 2023

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Slow music loading
« Reply #20 on: December 17, 2012, 08:17:09 pm »
You're right. I've disabled it.
Laurent Gomila - SFML developer

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Slow music loading
« Reply #21 on: December 18, 2012, 02:01:50 am »
Thanks!
I hope a suitable solution can be found for that floating point format at some point as well.
JSFML - The Java binding to SFML.

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Slow music loading
« Reply #22 on: December 25, 2012, 12:39:05 am »
I wanted to ask about this ( I was about to post here on the forums ). Because about 4-6 months ago I used sf::Music and it worked pefectly ( couldn't hear cracking ) but now it takes SECONDS to load/stream. What is the current status?

How do VLC and other players stream their music/videos without these problems and how do I ...uh what do you call it reecode the audiofiles.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Slow music loading
« Reply #23 on: December 25, 2012, 01:06:58 am »
I wanted to ask about this ( I was about to post here on the forums ). Because about 4-6 months ago I used sf::Music and it worked pefectly ( couldn't hear cracking ) but now it takes SECONDS to load/stream. What is the current status?
You're right. I've disabled it.
Which means it's already fixed in the latest commit on GitHub (thus if you want it you have to download it and compile SFML on your own).

How do VLC and other players stream their music/videos without these problems and how do I ...uh what do you call it reecode the audiofiles.
I'm not sure where this questions should lead to...
Audio stuff is a complex topic and most of them use either some specific set of libraries or write their own thing. Since VLC is OpenSource you're free to look at their code. ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Slow music loading
« Reply #24 on: December 25, 2012, 10:55:51 am »
Quote
How do VLC and other players stream their music/videos without these problems
They most likely play the audio samples in their native format, instead of trying to convert them to a different one like SFML does.
Laurent Gomila - SFML developer