Author Topic: SCI1.1 Audio?  (Read 18683 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

SCI1.1 Audio?
« on: June 19, 2015, 01:54:59 AM »
Err...I think I'm missing something. How does one add digital audio to the game again? I can't find where it was explained before.


Brass Lantern Prop Competition

Offline troflip

Re: SCI1.1 Audio?
« Reply #1 on: June 19, 2015, 02:00:28 AM »
Drag a wav file into the resource view. Not very discoverable yet :P

I guess I could have a "new audio resource" button that pops up a file dialog to let you browse for a wav or something.

Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: SCI1.1 Audio?
« Reply #2 on: June 19, 2015, 02:41:26 AM »
I figured it out, actually. Thought I deleted the thread. Sorry!
Brass Lantern Prop Competition

Offline Cloudee1

Re: SCI1.1 Audio?
« Reply #3 on: July 01, 2015, 03:16:48 PM »
So what's the criteria for a recognized wav file...

I am trying to drag this one in, but I get an error that it's not a recognized wave file

sample Type 48000Hz, Mono, 16-bit

have also tried a 32000Hz, Mono, 8-bit version with the same error.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Kawa

Re: SCI1.1 Audio?
« Reply #4 on: July 01, 2015, 03:26:01 PM »
So what's the criteria for a recognized wav file...
I've had no trouble importing 22k 8bit mono, saved with no extra editor-specific junk.

Edit: the same sound in 32k was also found acceptable. But I haven't actually tried to play either of them in-engine...

Edit?: your main issue seems to be that your file does have extra junk at the end.
Edit?: both versions of my sound seem to play just fine in Sierra's terp. It's very probably just the junk at the end of yours.
Edit⁴: your sound at 48k 16-bit with the junk cut off didn't play, but 48k 8-bit did.
« Last Edit: July 01, 2015, 03:35:46 PM by Kawa »

Offline troflip

Re: SCI1.1 Audio?
« Reply #5 on: July 01, 2015, 03:52:29 PM »
My validation code is expecting a header size of 16 bytes, and yours says 18 bytes (although it still appears to be just 16 bytes). I'm not sure if it matters or not, I'll need to do more research. Maybe I can be more lenient?

[edit:] Ok, I've modified my code to allow importing your sound, but it plays at half speed in the Sierra interpreter (ScummVM) is fine. So I think it's having trouble with the sample rate. The sounds in LSL6 are all 22kHz, so I think you should limit it to that. This is 1993, after all :P

As for a workaround to let you use your sound before I release the next SCI Companion update, see if you can play with the export settings of your audio app to see if you can generate a wave without the extra 2 bytes in the header (not sure what they're used for?).

« Last Edit: July 01, 2015, 04:05:40 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lskovlun

Re: SCI1.1 Audio?
« Reply #6 on: July 01, 2015, 04:16:49 PM »
Relevant discussion: https://trac.ffmpeg.org/ticket/1843
Some sources seem to say that the extra field is required when using 16-bit sound, which might explain why it doesn't work for you (wasn't there a problem related to this earlier?)

Offline Kawa

Re: SCI1.1 Audio?
« Reply #7 on: July 01, 2015, 04:36:39 PM »
Relevant discussion: https://trac.ffmpeg.org/ticket/1843
Some sources seem to say that the extra field is required when using 16-bit sound, which might explain why it doesn't work for you (wasn't there a problem related to this earlier?)
I dispute your sources. I just made a dumb test recording (me saying "bleugh") and saved it as 22k mono, one copy in 16-bit and one in 8-bit. Both open and play in Media Player Classic just fine, and a quick glance at a hex editor shows the fmt chunks being equal in length.
« Last Edit: July 01, 2015, 04:41:45 PM by Kawa »

Offline troflip

Re: SCI1.1 Audio?
« Reply #8 on: July 01, 2015, 04:45:22 PM »
Relevant discussion: https://trac.ffmpeg.org/ticket/1843
Some sources seem to say that the extra field is required when using 16-bit sound, which might explain why it doesn't work for you (wasn't there a problem related to this earlier?)

From what I gather, the "bits per sample" field they are talking about being cut off on that page is actually the last two bytes of the 16 byte header (I think they are talking about the 14 byte header cutting that data off). It looks like the extra 2 bytes that can follow the 16 bytes are for extra "extensible" data, which I wouldn't care about (or know how to use). But I actually might need to skip past it if it's not zero, so I need to find a file that has this to verify (cloudee's file has 0 for this extra data).

As for any problems we had with the interpreter playing sounds before, I don't think this would be related - the WAVEFORMAT stuff is irrelevant when the resource is in the game, since Sierra has their own header format.
« Last Edit: July 01, 2015, 04:48:34 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: SCI1.1 Audio?
« Reply #9 on: July 01, 2015, 04:55:42 PM »
According to http://ccrma.stanford.edu/courses/422/projects/WaveFormat/, the two extra bytes are the ExtraParamSize field, which apparently shouldn't be there for PCM-format sounds. ElevatorDing.wav has this set to zero, so there's no ExtraParams to follow. It is a PCM file, so technically there shouldn't be an ExtraParamSize if this document is correct, but on the other hand it seems safe to ignore everything past the BitsPerSample field and the RIFF length field has the right value...

Offline troflip

Re: SCI1.1 Audio?
« Reply #10 on: July 01, 2015, 05:04:01 PM »
Yeah, I was able to make an ADPCM format wav with my audio editor, and it stuffed a bunch of extra data in there. Even skipping past the data though, I can't reliably read the format.

cloudee's file works though, since the extra data size is zero.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: SCI1.1 Audio?
« Reply #11 on: July 01, 2015, 05:08:07 PM »
Yeah, I was able to make an ADPCM format wav with my audio editor, and it stuffed a bunch of extra data in there. Even skipping past the data though, I can't reliably read the format.
This agrees with the doc I found.
Quote
cloudee's file works though, since the extra data size is zero.
And the length field correctly said it was eighteen bytes, even though there's not supposed to be an ExtraParamSize field.

So yeah. Respect the length fields, detect and disallow non-PCM files? That'd cover most bases, I guess. The only pitfall that comes to mind is having another chunk inbetween fmt and data but who even does that?

Offline Cloudee1

Re: SCI1.1 Audio?
« Reply #12 on: July 01, 2015, 09:13:02 PM »
So what audio software is everyone using?

I've been using Adobe Audition CS6 and no matter how I try to save this file, I can't get the file into companion.

Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Collector

Re: SCI1.1 Audio?
« Reply #13 on: July 01, 2015, 09:19:39 PM »
Does it take it if you use Audacity?
KQII Remake Pic

Offline Cloudee1

Re: SCI1.1 Audio?
« Reply #14 on: July 01, 2015, 09:25:41 PM »
That's what I am trying to find out before I start downloading and installing half a dozen pieces of software  ;)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


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

Page created in 0.072 seconds with 21 queries.