This content has been marked as final. Show 13 replies
Does it help if you use the queue() or setPlayList() sound channel commands?
When I told it to queue the next piece as the last page of the current piece is reached, there is a hiccup in the music as the CD spins up. So, I got rid of that.
I think I'm stuck with the time gap, I just need to know how to put in an animated graphic on the screen as the piece is loading.
You could place a tiny text file on the CD and "touch" it every 5
seconds or so to stop the CD spinning down.
-- movie script:
-- (requires PRegEx xtra, but any file-reading xtra would suit)
t = timeout().new("no_CD_spin_down", 5000, #mAccessCD, 0)
tList = re_read(_movie.path & "file.txt")
That could work, but the mp3s total 70 minutes. I guess movies play longer than that.
Does this script just read some little text file and ignore it over and over? I'll try it. I wonder what will happen when I pause the sound. I think it will work. Thanks.
> Does this script just read some little text file and ignore it over and over?
Accessing a file on the CD regularly should stop it spinning down, but
you may still have to deal with seek times. Although this can be
somewhat alleviated, it could still be slightly problematic.
I tried it using buddy's baReadIni and the CD light never came on during the piece. I put one script in on preparemovie and the other in on startmovie. The play sound is in the start movie. In every frame there are other scripts running, like when to change the music page (move to the next frame). Do you think that this is were this script should go? If I tell it to do it every frame will it run several of these scripts simultaneously?
I think it needs to happen regularly, but not every frame. I can't tell
why yours didn't seem to work - did you use my suggestion of a #timeout
object, or did you run it once only?
I used a #timeout. Nothing confuses me more than timeouts. I guess this is something that once it is called keeps doing its thing every so many seconds or so. So once it starts it just keeps doing it's thing until you tell it to forget it. And this scripts thing is to call up on mAccessCD every 30 seconds (which tells it to read some file).
Why do I have to use a #name (#mAccessCD) rather than just "mAccessCD"?
Do you think it matters that it I'm using ReadIni?
If I change the file name to something that is not on my computer "fake.txt" the program doesn't error.
> Why do I have to use a #name (#mAccessCD) rather than just "mAccessCD"?
It's a handler name and is required to be provided as a symbol.
> Do you think it matters that it I'm using ReadIni?
Not as long as the file you are reading works without errors for
whatever function you use.
The reason I suggested PRegEx is that it will happily read /anything/
(including binary executables) without a problem and it's free.
> If I change the file name to something that is not on my computer "fake.txt"
> the program doesn't error.
What do you mean "doesn't error"? Are you experiencing errors? When, and
what does the error message report?
I'm not experiencing errors, but I don't think the file is ever accessed. I put tList in the Object inspector and it remains void.
Buddy readIni will read any file too. The one you recommended is only for Mac and I need an Xtra that works on both platforms.
Here is my .ini file emptyfile.ini
Then in the StartMovie script I have
--keeps CD spinning
t = timeout().new("CD_Spin_Up", 5000, #mAccessCD, 0)
Then in a movie script called CD Access, I have:
tList = baReadini("Empty", "Empty", "not", the moviePath&"emptyfile.ini" )
How can I tell if this file is being read. I tried to see what would happen if I didn't have any ini file and the program ran just the same. I just don't think it's reading this file which is in the same directory as the program file.
> I'm experiencing errors, but I don't think the file is ever accessed.
Again, what does the error message say?
> The one you recommended is only for Mac
> and I need an Xtra that works on both platforms.
No, there is a Windows version of the xtra in the archive, but you need
to use Stuffit to uncompress/extract it
> Here is my .ini file emptyfile.ini
> Then in the StartMovie script I have
> --keeps CD spinning
> t = timeout().new("CD_Spin_Up", 5000, #mAccessCD, 0)
> on mAccessCD
put "accessing CD drive"
> tList = baReadini("Empty", "Empty", "not", the moviePath&"emptyfile.ini" )
> How can I tell if this file is being read.
By examining the result of the 'read' command.
I have added a line to the handler above. If you can open a run-time
message window (_player.debugPlaybackEnabled = 1) then you can examine
output. If you never see the message "accessing CD drive" then the
handler isn't being called and your problem lies elsewhere.
Are you sure the #startMovie handler is in a #movie script, not a #score
or #parent script?
They are movie scripts. I will test this like you said, but in the meantime I think I solved my problem. In order to get rid of the gaps between pieces as they are loaded from an external cast on the CD, I turned the external cast into an internal cast and told it to preload the whole thing (90 Megs). I'm not sure how this works, but it does. The program never has to access the CD again once it loads originally. Of course the program takes longer to load at, but there are no gaps. This will probably be a memory hog. I'm not sure how the whole memory thing works, but my gaps are gone and my splash bmp will give them something to look at while it's loading.
Another solution (avoiding preloading):
_movie.go("wait") -- first go to a frame with a "spinning-up/ mp3" message.
updatestage -- need to show frame change mid-code.
sound(1).play(member("yourmp3") -- assumes this is synchronous and causes the spin-up...
_movie.go("playing") -- go to whatever frame you want to show playing mp3.
Just a thought, didn't try it. You could also move sprites on/off the stage instead of going to a new frame. Just use updatestage so the stage updates while you're in the code.