Author Topic: SQ3: Where is "Where am I?"?  (Read 4848 times)

0 Members and 1 Guest are viewing this topic.

Offline ZvikaZ

SQ3: Where is "Where am I?"?
« on: September 30, 2020, 08:59:37 AM »
Hi.

In SQ3 intro, Roger says "Where am I?".
(Which *was*, or *wasn't* heard by the Soundblasters of the Dos era, I don't know - I have seen some different reports of this; I had only PC speaker at the time, anyway...)

It's in room 155. Seems to be sound resource 100:
Code: [Select]
(instance whereSound of Sound
(properties
number 100
priority 5
)
)
ScummVM debugger also reports that it's number 100.

However, I can't play it in SCICompanion.
It seems to treat it just like (an empty) regular MIDI resource, without digital sample.

Citing from http://sci.sierrahelp.com/Documentation/SCISpecifications/19-SoundSubsystem.html#AEN2490:
Quote
SCI0 Sound resources can also contain digital samples, although an SCI remake of KQ1 is the only DOS game I know of that includes them. These files still contain MIDI data, but the wave data is appended at the end. The MIDI data is an approximation of the sound effect for hardware that can't play digital sound.

So, is it possible that SCICompanion just ignores the wave data at the end?
Or is there some way to access it?



Offline MusicallyInspired

Re: SQ3: Where is "Where am I?"?
« Reply #1 on: September 30, 2020, 09:24:07 AM »
It worked if you had the right driver but SQ3 was never bundled with that driver. It's available on Sierra Help Pages though.

Usually you have to select the "Digital" patch in the SCI Synth dropdown menu on the Sound Resource (above the play button and transport), but "Digital" isn't an option it seems. SCI Viewer can play it just fine, though.

Digital samples in SCI0 were simply appended to the end of a sound resource, from what NewRisingSun told me. He wrote a program to add sound to an SCI0 sound resource but it had to be 11025 hz 8-bit mono and the resulting sound file could be no larger than a certain byte size (I forget. 65535 I think?).
« Last Edit: September 30, 2020, 09:31:19 AM by MusicallyInspired »
Brass Lantern Prop Competition

Offline ZvikaZ

Re: SQ3: Where is "Where am I?"?
« Reply #2 on: September 30, 2020, 09:35:22 AM »
Well, that's interesting info.
Because what I really want, is to modify the sound resource.

So, if SCICompanion can't do it (@Kawa, maybe it can be fixed?), I'd need other tool.
Do you know where can I find NRS tool?
Any other recommendations?

Offline MusicallyInspired

Re: SQ3: Where is "Where am I?"?
« Reply #3 on: September 30, 2020, 10:04:51 AM »
http://sciprogramming.com/community/index.php?topic=592.0

What you're looking for is the AddWAV.exe program.
Brass Lantern Prop Competition

Offline Kawa

Re: SQ3: Where is "Where am I?"?
« Reply #4 on: September 30, 2020, 10:19:40 AM »
From what I can see, SCI Companion does acknowledge there is a digital sample in there. I open sound.100 and I see one row marked "D". This being a MIDI-oriented editor, it doesn't bother trying to draw the waveform like it does the note events, nor does it try to play anything. Exporting the resource and opening it in Audacity as an unsigned 8-bit 11000 Hz raw PCM, playing that gives me a click of the header, and a perfectly fine "where am I?".

Digital samples in SCI0 were simply appended to the end of a sound resource, from what NewRisingSun told me.

All that being a match, you could make do with a hex editor and some smarts. I'd point out some official tool but I can't seem to find any.

Quote from: Ravi Iyengar
The digital sample header is 44 bytes long. Offset 14 in the header contains the frequency as a short integer. Offset 32 contains the sample length, also as a short integer.
But since we're talking about a digital-only sound, without any MIDI in it, we can ignore all that. Looking at the raw sound.100 in a hex editor, I see frequency 11000 (0x2AF8) at offset 0x33 and the sample length 7415 (0x1CF7) at offset 0x45. Selecting everything from 0x51 (a 0x7A) to the end is a span 7415 bytes in size, so that's our sound All else being equal, one should be able to just remove everything from 0x51 on, record a new sound of the proper format, append it in place of the original, and adjust the size field accordingly.

Attached is a proof of concept where I did exactly that, to make Roger sound like a confused Dutchman.

Offline gumby

Re: SQ3: Where is "Where am I?"?
« Reply #5 on: September 30, 2020, 08:06:35 PM »
Collector and I collaborated a (long) while back and created a sound editor tool for SCI0 sounds.  I can't seem to put my finger on it, but I want to say that it was able to read and create SCI0 sound resources that had both MIDI and WAV data inside them.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: SQ3: Where is "Where am I?"?
« Reply #6 on: September 30, 2020, 08:32:44 PM »
That ended up in a collection of a number of SCI sound utilities with a GUI. Haven't even looked at it in a long time. http://sciwiki.sierrahelp.com//index.php?title=SCI_Sound_Utilities
KQII Remake Pic

Offline ZvikaZ

Re: SQ3: Where is "Where am I?"?
« Reply #7 on: October 01, 2020, 10:27:37 AM »
Thanks guys. Sounds great ;-)
I'll check it.

Offline ZvikaZ

Re: SQ3: Where is "Where am I?"?
« Reply #8 on: October 04, 2020, 11:37:00 AM »
It took me time to check, but it works great!
Thanks.

I'd just note, that the GUI has problem with Hebrew file names. I had to change my .wav file to English for it to work (at least, with Windows 10).
I assume that you won't fix it (it's not really worth the bother...), but maybe it should be documented somewhere.
(or maybe add a simple `if` to warn in case of a non-regular-ascii filenames, and suggest renaming)

Offline Collector

Re: SQ3: Where is "Where am I?"?
« Reply #9 on: November 29, 2021, 09:33:02 AM »
Following this from your link in the Space Quest III French thread, I thought I would look into this. Can you upload the WAV file with the Hebrew file name for me to try?
KQII Remake Pic

Offline ZvikaZ

Re: SQ3: Where is "Where am I?"?
« Reply #10 on: November 29, 2021, 04:42:44 PM »
Following this from your link in the Space Quest III French thread, I thought I would look into this. Can you upload the WAV file with the Hebrew file name for me to try?
Well, that's embarrassing. I haven't kept that specific file. And now I cannot reproduce the problem. I have tried Hebrew file name, inside a Hebrew directory, with spaces, and even an apostrophe. But no avail. It always work :-)

So, I'm glad that's your tool is such robust. You can "close" that bug report.
Thanks for wanting to fix it, though ;)

EDIT
====
It is *working*, however, there is something weird about Hebrew files - they don't show Encoding, Sample Rate and Channels information.

Screenshot of the difference is attached, as well as the Hebrew file. You can rename it to English, and see the different behaviour.
« Last Edit: November 29, 2021, 04:57:34 PM by ZvikaZ »

Offline Collector

Re: SQ3: Where is "Where am I?"?
« Reply #11 on: November 29, 2021, 08:01:40 PM »
The reason for that is that it uses SoX ( http://sox.sourceforge.net/ ) to get the wave file header info. This is the first C# project I did. This is before Phil developed SCI companion 3 and audio support tools for fan SCI projects still relied on the old misc audio SCI tools, including Soundbox. The GUI is reading the file name, but not the SoX utility. To fix it I would have to build SoX to add that support and my C skills are sorely lacking or I would have to roll my own C# class to extract the wav file header info. I am not in too much of a hurry to invest much time on this. I would suspect that SoX would work if it was built with Unicode support.
KQII Remake Pic

Offline ZvikaZ

Re: SQ3: Where is "Where am I?"?
« Reply #12 on: November 30, 2021, 03:18:03 AM »
Well, I don't think that it's worth the effort the recompile SoX - it could be a very deep rabbit hole, and my problematic use case is probably rare.

However, if you do want to improve things a little, there are two options that might be easy:
1. If the filename contains non ascii characters, copy it to a temp file with regular English name, and silently work on that temp file. The user won't even be aware of that.
2. If the filename contains non ascii characters, pop up a dialog box recommending to rename it to English in order to have the details table working.

Anyway, this thing is low priority. Your tool is great and does it job perfectly.

Offline Collector

Re: SQ3: Where is "Where am I?"?
« Reply #13 on: November 30, 2021, 08:13:46 AM »
I had thought of your first suggestion, but got distracted by looking into fixing it the right way of getting the info directly in C#. In the end I am not too inclined to invest much time on a tool of such limited usefulness these days, especially since it still works. Any more it might only be of use for translating existing earlier SCI games.
KQII Remake Pic

Offline Collector

Re: SQ3: Where is "Where am I?"?
« Reply #14 on: November 30, 2021, 10:39:22 PM »
I decided that simply making a temporary ASCII named copy for SoX wasn't that big of a chore, so here is test build for you to try. If you report that it is OK I'll update the Wiki with the new build.
KQII Remake Pic


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

Page created in 0.104 seconds with 24 queries.