[Scummvm-devel] Fw: SCI: SQ4 Talkie DoSound

M. Kiewitz m_kiewitz at users.sourceforge.net
Mon Jul 6 09:37:57 CEST 2009


>Hello M. Kiewitz
>
>We are aware of the problem with SQ4CD. Your observations are quite 
>interesting. I can't think of why you would want a new iterator for this, 
>instead of feeding the correct kind of data to the current one and having a 
>special case for SQ4 for the DoSound event. Could you please attach your 
>code up to now as a patch, so that we can see why a new iterator is needed?
>
>Regards
>Filippos

Hi Filippos,

Well, I had the sound played within DoAudio, but still the script needs to get informed after the sound has played. Converting an audio resource to a sound resource isn't trivial (at least I think so, I mean creating an iterator is much easier).

I'm not quite done yet, as I said I had to change data/size to Resource to get resource-header within the iterator. Also currently the iterator just creates the event immediately without even playing the sample - I would need to split SfxState::getAudioStream, so that I can get the audio stream for playing from an actual resource instead of a resource number. That way I should be able to calculate sample duration and then get the event fired at the correct moment.

That's why I was asking if someone is able to think of a better way of doing it, because much code needs to get changed to make it working. Playing the sample from within kDoAudio is trivial, but the event needs to get fired - so I see one way of creating an iterator for event firing only and one of creating an iterator for playing sample and then firing the event. I think the latter would be the better approach.

If you can come up with code that converts audio to sound resource, then that should work as well. But I'm honest - I can't do this.

Regards
  M. Kiewitz



      





More information about the Scummvm-devel mailing list