Page 1 of 1

[20 Apr 2006] Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by Oliver
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Apr 2006 20:14:09 +0100

Hi list, Just a short Introduction, My Name is Oliver aka Bladerunner (or Canuma on some IRC chans) I am pretty new to Hollywood and finally found some time to play around with it, it`s nice as it really brings fast results. However I guess I will have a lot of questions from time to time, thankfully this list exists ;)

Ok, first "Problem": I want to play an mp3 as background sound, but it should loop infinitely. As far as I can see, the PlayMusic() function doesn`t offer loop for a music file. So I thought I can trick around and use the PlaySample() function instead, however this seems to introduce other problems. One is, that it plays the mp3 way too fast. This might probably be solved using the pitch argument, however another problem is, that this way my prog takes significanly longer to start, I guess the PlaySample Function loads the whole sample into memory (as it uses datatypes) while PlayMusic actually streams? Is that correct? Also I want to avoid using datatype loading when possible. So is there another Solution how to loop mp3 files? Or did I simply overlook something?

regards Oliver

[20 Apr 2006] Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Apr 2006 12:35:53 -0700 (PDT)

Try using InstallEventHandler and telling it to play the mp3 song OnMusicEnd.

[20 Apr 2006] Re: Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Apr 2006 15:41:00 -0700 (PDT)

Yep, I really love how fast Hollywood can be used to generate some nice looking apps.

BTW: Welcome to the Hollywood forum! The more people who join and participate in the forum, the more we will be able to exchange ideas and help each other.

[21 Apr 2006] Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by Oliver
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 21 Apr 2006 00:03:23 +0100

Hallo Rev.

Nice, that did the trick ;) Thanks It is really amazing, just a few hours work (including to try to understand how Hollywood works) and my Scumm Frontend does what it should, launch Scumm Games, looking nice and plays some background music ;) Sure it does need some cleanups here and there, but I have a working prog :) Nice

regards Oliver

[21 Apr 2006] Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 21 Apr 2006 13:56:44 +0200
I guess the PlaySample Function loads the whole sample into memory (as it uses datatypes) while PlayMusic actually streams? Is that correct?
Exactly. You should never use LoadSample() or @SAMPLE with MP3 files. It will always load the whole data into memory because sound.datatype does not support streaming. PlayMusic() on the other hand streams the data using mpega.library.

[22 Apr 2006] Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by Oliver
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 17:22:05 +0100

Hallo Andreas
Exactly. You should never use LoadSample() or @SAMPLE with MP3 files. It will always load the whole data into memory because sound.datatype does not support streaming. PlayMusic() on the other hand streams the data using mpega.library.
Well, I hoped that I could use the loop parameter, which is available for PlaySample() but not for PlayMusic() However, with the event handler function I solved that. I even utilized the event handler thingy a bit more, when the scumm screen opens, the music "magically" stops when the scumm screen is in active again, it starts playing again :) btw, is it also possible to monitor a given task? lets say event handler looks for the scummvm task, if its there it starts an action if this task is gone it stops again. would come in handy for another project I have in mind. If not, is it hard to implement in future hollywood versions? Or is there something similar with the dos functions? (Sorry if it is indeed allready mentioned, I am still in a learn process ;) )

regards Oliver

[22 Apr 2006] Re: Re: Music loop

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 20:41:37 +0200
Well, I hoped that I could use the loop parameter, which is available for PlaySample() but not for PlayMusic() However, with the event handler function I solved that. I even utilized the event handler thingy a bit more, when the scumm screen opens, the music "magically" stops when the scumm screen is in active again, it starts playing again :) btw, is it also possible to monitor a given task? lets say event handler looks for the scummvm task, if its there it starts an action if this task is gone it stops again. would come in handy for another project I have in mind. If not, is it hard to implement in future hollywood versions?
No, it is not hard to implement but it doesn't fit into the concept ;-)

You could probably monitor the "InactiveWindow" event. You will receive this event when the Hollywood window loses the focus. This should happen when ScummVM opens its window.