Author Topic: Looping Audio in SCI1.1?  (Read 105 times)

0 Members and 1 Guest are viewing this topic.

Offline cdb-boop

Looping Audio in SCI1.1?
« on: April 25, 2026, 06:25:00 PM »
I'm porting a SCI1 game to the SCI Companion's SCI1.1 template game and some of the SCI1 Sound assets have a digital track embedded. I used Sierra Resource Viewer to extract all the digital tracks as WAV files and add them as Audio resources (using unused numbers, as Sound and Audio assets share a namespace).

I have been auditing the code's 374 play: calls and making modifications to affected sounds. For example, using (DoSound sndGET_AUDIO_CAPABILITY) to dynamically swap between using Sound and Audio asset depending on audio driver. I also ended up creating a DigitalSound wrapper class to emulate cases of dynamically setting a Sound object's number property for play later.

So far I've found two cases (battle yelling and tavern chatter) where a Sound with a digital track is looped for ambiance. I looked at the SCI Companion Docs but I didn't see a way to loop DoAudio in SCI1.1. Is there a built-in way to loop Audio, like setting the Sound class's loop property to -1? I was wondering if it was possible to attach a script to a room's script to detect when it was time to loop the audio, or make a global list like gSounds or global object like gMusic and add check in the main game loop. Or should I just use gumby's sciAudio which supports looping but is not "authentic"?

Is there a best or intended way to loop Audio in SCI1.1?



Offline cdb-boop

Re: Looping Audio in SCI1.1?
« Reply #1 on: April 25, 2026, 08:20:08 PM »
Never mind. I realized you can just call an Audio resource with DoSound and loop with -1 infinitely.

Offline doomlazer

Re: Looping Audio in SCI1.1?
« Reply #2 on: Yesterday at 06:57:22 PM »
(using unused numbers, as Sound and Audio assets share a namespace).

I believe that despite seeming to share the same resource numbers you can differentiate between sound and audio by prepending a 1 before the number to use digital audio.

For example, in LB2 most songs are MIDI, but "The Archaeologist Song" has both a MIDI version and an audio version with lyrics. So you can call the MIDI version with 312 or the digital version with 1312.

Offline lskovlun

Re: Looping Audio in SCI1.1?
« Reply #3 on: Yesterday at 07:04:07 PM »
Yeah, that's what one game does. But there is code in the interpreter to make sure that it generally doesn't matter whether a sound resource is MIDI or Wave.

Offline Collector

Re: Looping Audio in SCI1.1?
« Reply #4 on: Yesterday at 07:38:49 PM »
in LB2 most songs are MIDI, but "The Archaeologist Song" has both a MIDI version and an audio version with lyrics. So you can call the MIDI version with 312 or the digital version with 1312.

As in KQ5 where The Weeping Willow song has both.
KQII Remake Pic


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.075 seconds with 22 queries.