Author Topic: Music in the ScreenSaver  (Read 1540 times)

kyofast

  • Newbie
  • *
  • Posts: 2
    • View Profile
Music in the ScreenSaver
« on: April 18, 2020, 11:09:08 AM »
Good afternoon.

I would like to know if there is any way to put custom music on the screen saver, if so what would be the code?

Thanks.

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: Music in the ScreenSaver
« Reply #1 on: April 24, 2020, 12:04:42 PM »
try:

function 'functionName' (){
     if(screensaver == true){
          local 'name' = fe.add_sound("'path_to_audio'")
          'name'.playing = true
}
}

*notes:
     I've never had a screensaver on before, so I have no idea what the screensaver check actually is (the provided if() code will not work)
     replace 'funcionName' with any name you want (remove the apostrophes)
     replace 'name' with any other name you want (remove the apostrophes)
     replace 'path_to_audio' with your audio clip (remove apostrophes, but keep the quotation marks)(note that the provided path is relative to your layout.nut file)

hope this helps, also check the following sites:
http://www.squirrel-lang.org/squirreldoc/index.html
https://github.com/mickelson/attract/blob/master/Layouts.md#add_sound

kyofast

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Music in the ScreenSaver
« Reply #2 on: April 25, 2020, 01:56:20 PM »
thank you very much, i will try it

Cheers