Author Topic: Playmusic freeze  (Read 504 times)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4234
    • View Profile
    • Portfolio
Playmusic freeze
« on: 2019-Jul-17 »
Hello there, quick question:
I have been getting a quick computer freeze every time music is played with that command.
Mp3 is horrible as it takes more than a full second, raw wav takes 1/10 of a second. But all motion freezes.

What the heck, that did not happen on my old machine but happens on my new one, which was a lot of trouble taking win 10 out to use win 7, lots of drive problems.

So, is that only on my side? Is anyone experiencing problems with playmusic and loop?

Tried v16 steam and no good either, tried at 2 friends pc and wav raw had no problem, which leads me to think my drivers are bugged.
One could switch to playsound though. What do you guys think?

Offline Snoopy

  • Dr. Type
  • ****
  • Posts: 290
    • View Profile
Re: Playmusic freeze
« Reply #1 on: 2019-Jul-21 »
I remember that I had a lot of problems with the playmusic function (especially on mobile) and finally, I used the playsound function.

Moreover, at the time of launching this function, everything slows down (as in my demo with the music of 2001, when the music stops and restarts, the demo slows down).
Nevertheless, it is a bit normal because the music is not loaded in memory, unlike the playsound function.

Erico, you should convert all yours musics to be compatible with the playsound function. Personally, I think this is the best solution at the moment.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4234
    • View Profile
    • Portfolio
Re: Playmusic freeze
« Reply #2 on: 2019-Jul-22 »
Ok, I got some hints about doing that from the forum and will update my framework to use that for future games.
Thanks.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2632
    • View Profile
Re: Playmusic freeze
« Reply #3 on: 2019-Jul-22 »
I remember that I had a lot of problems with the playmusic function (especially on mobile) and finally, I used the playsound function.

Moreover, at the time of launching this function, everything slows down (as in my demo with the music of 2001, when the music stops and restarts, the demo slows down).
Nevertheless, it is a bit normal because the music is not loaded in memory, unlike the playsound function.

Erico, you should convert all yours musics to be compatible with the playsound function. Personally, I think this is the best solution at the moment.

Playmusic slows your code down, wow. This is a bit of a concern TBH. Have you tried this recently Snoopy?
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Snoopy

  • Dr. Type
  • ****
  • Posts: 290
    • View Profile
Re: Playmusic freeze
« Reply #4 on: 2019-Jul-23 »
Yes, as in my "2001 Demo" for a contest on the forum.
Or at least, that's the case on my old PC.

But I specify that it's when the music restarts.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2632
    • View Profile
Re: Playmusic freeze
« Reply #5 on: 2019-Jul-24 »
So the music is streamed of the HD, I never knew that.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4234
    • View Profile
    • Portfolio
Re: Playmusic freeze
« Reply #6 on: 2019-Jul-24 »
Yes I noticed if the game is running from a slow speed drive or a pen drive, it struggles when streaming music.
I really wish the music I´m using was IT as I suspect I would not bring all that trouble that way.

Offline Snoopy

  • Dr. Type
  • ****
  • Posts: 290
    • View Profile
Re: Playmusic freeze
« Reply #7 on: 2019-Jul-25 »
Personally, I don't find it abnormal.
This allows to have a very good quality of music without cluttering the memory and for the rest there is the playsound function.

It's the same as for the playmovie function.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4234
    • View Profile
    • Portfolio
Re: Playmusic freeze
« Reply #8 on: 2019-Jul-26 »
I never had trouble with it, just now that I got this new computer with a very shitty on board sound, it renders games with playmusic unplayable if the music kicks in with action ongoing.