Author Topic: was music loop crash ever solved?" solved  (Read 3501 times)

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
was music loop crash ever solved?" solved
« on: May 25, 2019, 05:19:01 PM »
was music loop crash ever solved?

cant seem to find,  any info...  but it happens when using..

kind of old topic...but still revalant :-\

after song ends...
Code: [Select]
local mysong = fe.add_sound("music/music-3.mp3");
mysong.loop = true;
mysong.playing = true;
« Last Edit: May 25, 2019, 05:22:07 PM by jedione »
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: was music loop crash ever solved?" solved
« Reply #1 on: May 25, 2019, 05:23:44 PM »
i new i  saw it somewere....

solved..... thought it would be nice to just be fixed

Code: [Select]
// [fe.sound.loop = true;] cause AM crash. I don't know the reason exactly. but, It works well as Plan B.
function playSound( path, loop=false ) {
local sound = fe.add_sound( path, true );
if( ! loop && ! sound.playing ) {
sound.playing = true;
}
if( loop ) {
fe.add_ticks_callback( this, "loopSound" )
}
function loopSound( ttime ) {
if( ! sound.playing ) {
sound.playing = true;
}
}
}
help a friend....

kent79

  • Hero Member
  • *****
  • Posts: 842
    • View Profile
Re: was music loop crash ever solved?" solved
« Reply #2 on: June 14, 2021, 03:07:20 PM »
Thank you for your sharing. You help me a lot   :)