I just noticed that playback of sound using the EventRecorder stops abruptly if the event-recording includes a painting session. Just before the paint palette appears on playback, sound playback simply stops.
I've tracked this down to the recent addition of WorldStethoscope code, in which a "SoundPlayer shutDown" call was added to PasteUpMorph >> stopRunningAll.
So it seems that either #stopRunningAll should be restored to its original functionality, which was to suspend all ticking scripts but not to mess with sound playback, or else we can change the get-ready- to-paint code so that it no longer calls #stopRunningAll, but instead calls some to-be-written method that does the original intended work of #stopRunningAll, but without the additional clobbering of sound.
What do you think?
Cheers,
-- Scott
On Nov 30, 2006, at 14:15 , Scott Wallace wrote:
I just noticed that playback of sound using the EventRecorder stops abruptly if the event-recording includes a painting session. Just before the paint palette appears on playback, sound playback simply stops.
I've tracked this down to the recent addition of WorldStethoscope code, in which a "SoundPlayer shutDown" call was added to PasteUpMorph >> stopRunningAll.
So it seems that either #stopRunningAll should be restored to its original functionality, which was to suspend all ticking scripts but not to mess with sound playback, or else we can change the get- ready-to-paint code so that it no longer calls #stopRunningAll, but instead calls some to-be-written method that does the original intended work of #stopRunningAll, but without the additional clobbering of sound.
What do you think?
I guess this has to do with the addition of a generic sound slot in players. There is a new "sound" category in tile viewers, which allows to start and stop playing a sound of a specific frequency. Very cool in my opinion, I used that for the sound project I sent around.
Now, if you use that, those sounds would not stop automatically when stopping scripts. They do not even stop when you delete the object, which is a bug I think. So instead of shutting down SoundPlayer, one might want to go through all scripted morphs and only stop their sounds. Or modify the code to have a central registry of playing sounds to avoid iterating through all players.
On a related note, we might think of a more general way to suspend and resume sound. The activation/deactivation code in SugarLauncher also shuts down SoundPlayer. Thus, if you switch activities while a sound is playing, it will stop, and not automatically resume when switching back. I have not found a method in SoundPlayer that would allow this suspending without removing all active sounds.
In fact, I think we should use the same method on a project level - when entering a project, resume playing all sounds as they were when we left the project. Anyone wants to tackle this?
Another faintly related Todo item is the transparent saving of a project - that is, export a project without user interaction, and later resume where we were. We need that for the automatic saving in the OLPC's journal. I wonder if ImageSegments would help here, I would certainly hope so for speed reasons. But they would have too work without saving the image itself.
- Bert -
Hi, Scott and Bert,
In fact, I think we should use the same method on a project level - when entering a project, resume playing all sounds as they were when we left the project. Anyone wants to tackle this?
I was suspicious about the lines, but didn't speak up about it. Sorry about that.
Another faintly related Todo item is the transparent saving of a project - that is, export a project without user interaction, and later resume where we were. We need that for the automatic saving in the OLPC's journal. I wonder if ImageSegments would help here, I would certainly hope so for speed reasons. But they would have too work without saving the image itself.
I'll have a look at them. Thank you!
-- Yoshiki
Okay, I've modified #stopRunningAll, via update 1134stopSound-sw, so that instead of issuing the broadside "SoundPlayer shutDown", the individual players in the project are each now told individually to stop their sounds. (There is actually no extra player-enumeration overhead in doing this because #stopRunningAll was already iterating through a project's players.)
This means that painting sessions, as well as use of the "Stop" button, can again be included in event-recordings without fear of thereby clobbering sound playback.
Cheers,
-- Scott
On Nov 30, 2006, at 5:32 AM, Bert Freudenberg wrote:
I just noticed that playback of sound using the EventRecorder stops abruptly if the event-recording includes a painting session. Just before the paint palette appears on playback, sound playback simply stops.
I've tracked this down to the recent addition of WorldStethoscope code, in which a "SoundPlayer shutDown" call was added to PasteUpMorph >> stopRunningAll.
So it seems that either #stopRunningAll should be restored to its original functionality, which was to suspend all ticking scripts but not to mess with sound playback, or else we can change the get- ready-to-paint code so that it no longer calls #stopRunningAll, but instead calls some to-be-written method that does the original intended work of #stopRunningAll, but without the additional clobbering of sound.
What do you think?
I guess this has to do with the addition of a generic sound slot in players. There is a new "sound" category in tile viewers, which allows to start and stop playing a sound of a specific frequency. Very cool in my opinion, I used that for the sound project I sent around.
Now, if you use that, those sounds would not stop automatically when stopping scripts. They do not even stop when you delete the object, which is a bug I think. So instead of shutting down SoundPlayer, one might want to go through all scripted morphs and only stop their sounds. Or modify the code to have a central registry of playing sounds to avoid iterating through all players.
etoys-dev@lists.squeakfoundation.org