TresCom Forums

TresCom : The Trespasser Fan Gateway...
It is currently Mon Jun 25, 2018 2:14 am

All times are UTC




Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: pcm encoder
PostPosted: Tue Nov 16, 2010 5:00 am 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
Mainly, this is a test utility and it can only encode mono (single channel), 16bit 22050 pcm waves. As said, it's a test to create a trespasser compatible ima/dvi adpcm wav, import it and have it play all the way through in-game. I tested a few of the longer voice overs and 1 music clip that I converted to single channel (22050 sample rate) using cool-edit. They all played satisfactory but the encoding isn't 100% accurate as of yet.

For more info, see the read_me file. Also, beyond trying to figure out how to utilize this class and writing out the wav file, I take no credit for this. That belongs to a J.D. Medhurst (aka tixy) who wrote and made the class available. You can visit his website here.

See temp_page (on sig) for download


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Tue Nov 16, 2010 10:02 pm 
Offline
Albertosaurus
Albertosaurus
User avatar

Joined: Mon Apr 24, 2006 12:12 pm
Posts: 2197
Location: Australia
When this is perfected we could use it as a default import option for Audio :D unless we need quality over storage ;)

_________________
~ They told me humans weren't real... I proved them wrong.
ImageAnthropology ~ A beautiful tale.
EpicZen
Carnivores Hub ~ Need the full games without all the hassle of torrents or viruses? Run on over to EpicZen's Carnivores Hub!


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Wed Nov 17, 2010 8:01 pm 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
Uhm... why not just use "Audacity" and be happy?

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Wed Nov 17, 2010 10:11 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 10781
Location: Lima, Peru
Hmmm... has anyone tried IMA ADPCM files saved with Audacity and imported into a TPA file? I remember someone tried using IMA ADPCM WAV files in the past (can't remember what program was used), but they wouldn't play well once imported...
Rebel wrote:
it's a test to create a trespasser compatible ima/dvi adpcm wav, import it and have it play all the way through in-game.

_________________
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Wed Nov 17, 2010 10:23 pm 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
I would be astonished if this is a problem. If though it is one simply use SoX. There's nothing SoX can't do and it's command line so you can embed it into scripts to automatize your production pipeline.

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 12:56 am 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
Sox, eh? Never tried it, though I know cool_edit created ima/dvi wavs don't work. They play a second or two & then cut off, just as I expected they would. The devil is in the details, as the saying goes. True audio programs can handle a wide range of audio formats and variations. Tres isn't an audio program though, it's a game and as such has strict requirements for its audio loader to work. It was never designed nor intended to accommodate any other audio formatting, block alignments or sampling rates other than what it was designed for and the Devs really had no reason to make allowances for it to do that.


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 7:06 pm 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
I'm rather sure it should work. Just tell me what exact format parameters the WAV has to be like and I'll see if Audacity or SoX can do it.

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 7:59 pm 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
if mono;

22050, 16bit, 1024 block alignment


stereo;

41000, 16bit, 2048 block alignment


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 8:41 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 10781
Location: Lima, Peru
Here's a test with Audacity:


Attachments:
269.zip [4.31 KiB]
Downloaded 204 times

_________________
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 9:08 pm 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
Should be no problem for Audacity. Save as "Other Uncompressed Format" and use "IMA ADPCM" as format. Before exporting set the track to "Mono", "22050" and "16 Bit" and the project to "22050". Then the produced file should be correct. What exactly you mean with block size I don't get as I can not recall this format having any "block size" restrictions or requirements of any kind. It's a 4-bit format hence 1024 or 2048 "block size" (whatever this is supposed to be) is automatically given since both 1024 and 2048 are divisible by 4.

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 9:21 pm 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
Yea, need a bigger wave sample than that to test out. Block alignment is how many samples there are inbetween headers (before the next sample blocks begin).

Take a voiceover wav from trespasser, encode that and upload. Something at least a few words long.


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 11:39 pm 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
In between headers? There is only one header and the rest is a continuous stream of nibbles. Ah wait... yeah... the M$-fuck-me-up variation of IMA ADPCM has an abomination like "block size". I think I see now where you come from. From my test Audacity uses "512" as the block size on a mono file with static noise. You don't want to say they did "not" read the block header but assume 1024 all the time in Trespasser? That would be very short stupid even for games of that time.

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Thu Nov 18, 2010 11:51 pm 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
Quote:
You don't want to say they did "not" read the block header but assume 1024 all the time in Trespasser? That would be very short stupid even for games of that time.


Yes, I believe that's what the audio loader does indeed do.


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Fri Nov 19, 2010 2:05 am 
Offline
Compsognathus
Compsognathus
User avatar

Joined: Fri Jan 04, 2008 12:14 am
Posts: 1066
Location: Switzerland
That actually is "very" stupid. Way to make themselves (the developers and artists) extra work. I don't know right now if SoX has an option to alter the block size. Such an assumption about the block size is quite an exotic requirement.

_________________
Image
Leader, Head Programmer: Epsylon | Drag[en]gine ( Wiki )


Top
 Profile  
 
 Post subject: Re: pcm encoder
PostPosted: Fri Nov 19, 2010 2:07 pm 
Offline
-=TresCom Developer=-
-=TresCom Developer=-
User avatar

Joined: Sun Nov 10, 2002 10:26 pm
Posts: 4760
Location: That country nobody likes (you know the one)
Dragonlord wrote:
That actually is "very" stupid. Way to make themselves (the developers and artists) extra work. I don't know right now if SoX has an option to alter the block size. Such an assumption about the block size is quite an exotic requirement.


Well, the encoder I posted does the job, but the created adpcms are not optimum quality. On a scale of 1 - 10, I'd give most waves encoded a 7 or 8 in quality. Acceptable in most cases -


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group