pcm encoder

List your programs here (game-related or other software).

Moderators: scallenger, Rebel, madppiper, TresCom Support Team

glitchhunter09
Pteranodon
Pteranodon
Posts: 792
Joined: Sun Sep 07, 2008 3:08 pm
Location: Bloomington, IN, USA

Re: pcm encoder

Post by glitchhunter09 »

Thanks Rebel! :mrgreen:
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: pcm encoder

Post by Rebel »

Hey Hilwo, machf, how's it going. Nice to see you 2 still around. I'm busy with work mostly, & life, well, that pretty much sucks, but no point in complaining. Grin n' bear it, right? Be back for xmas -
User avatar
awesome24712
Pteranodon
Pteranodon
Posts: 889
Joined: Sun Oct 02, 2011 1:56 am
Antispam: No
Location: USA
Contact:

Re: pcm encoder

Post by awesome24712 »

All right, all right—something's wrong.

I'm trying to import new sounds into my TPA file that I plan to use for my level, "Craters." So far, no luck.
The First thing I tried to do is use Audacity, seeing that I already have it installed. Made my sound 16-bit, mono, at a 22050 sample rate, saved as a IMA ADPCM .wav sound file. Then I tried to convert into a .cau for TPA_Reader, and it gives me an error. I tried a test to see if I was converting or importing incorrectly by using a .wav from another TPA, but that file imported just fine. I opened both files up in Audacity to compare them, but I saw no differences (other than the Bit-Rate, but I don't think that should affect anything). But after seeing other posts on this thread about Microsoft's IMA ADPCM not having the correct block size or something like that, I decided to try Rebel's encoder here...

I got the same thing as Draco did:
Draconisaurus wrote:I drag a file of 22050/mono/16-bit into the window. It displays the filepath of the wav. Nothing happens.. I press enter, it Exits, and no changes have been done. Could someone enlighten me as to how I use this to encode waves?? :)
Although I don't quite understand Machf's explanation:
machf wrote:I guess you don't have to drag it onto the window after clicking on it, but onto the program's icon next to its name, rather... the same way you used other apps like swpz.exe
Anyone care to clarify on how I "drag 'n drop" to convert them? :?
Check out the HL2 mod I'm helping with: Image
Visit my Steam! http://steamcommunity.com/id/awesome24712/
Visit my YouTube! http://www.youtube.com/user/awesome24712

Post benchamrks:
1 [x] 2 [x] 4 [x] 8 [x] 16 [x] 32 [x] 64 [x] 128 [x] 256 [x] 512 [x] 1024 [ ] 2048 [ ] 4096 [ ] 9192 [ ]
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: pcm encoder

Post by machf »

Don't run the program... make a shortcut for it on your desktop (or wherever you like), then drag the file you want to open on top of the shortcut.
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
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: pcm encoder

Post by LtSten »

Similarly to how you'd drag files into a folder, except you're dragging onto a shortcut...
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
awesome24712
Pteranodon
Pteranodon
Posts: 889
Joined: Sun Oct 02, 2011 1:56 am
Antispam: No
Location: USA
Contact:

Re: pcm encoder

Post by awesome24712 »

... Ok...

Yep! Works fine now. Sorry for the trouble—Thanks! :) Never thought of that :P

EDIT: But, now how do I assign an '$Name' to a sound?
Check out the HL2 mod I'm helping with: Image
Visit my Steam! http://steamcommunity.com/id/awesome24712/
Visit my YouTube! http://www.youtube.com/user/awesome24712

Post benchamrks:
1 [x] 2 [x] 4 [x] 8 [x] 16 [x] 32 [x] 64 [x] 128 [x] 256 [x] 512 [x] 1024 [ ] 2048 [ ] 4096 [ ] 9192 [ ]
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: pcm encoder

Post by Rebel »

Well, if you're using tpa_reader, type in the stringname & any caption data you want assigned to the wave before you import the .cau file into the .tpa. There's a complete help file with the program, just hit the ? button, or go into the readers folder to access the hhp file directly. Note: you can only encode pcm files, and microsoft ima/pcms do not work in trespasser, therefore tpa_reader does not allow you to convert them into a .cau file for import.
User avatar
awesome24712
Pteranodon
Pteranodon
Posts: 889
Joined: Sun Oct 02, 2011 1:56 am
Antispam: No
Location: USA
Contact:

Re: pcm encoder

Post by awesome24712 »

Rebel wrote:Well, if you're using tpa_reader, type in the stringname & any caption data you want assigned to the wave before you import the .cau file into the .tpa. There's a complete help file with the program, just hit the ? button, or go into the readers folder to access the hhp file directly. Note: you can only encode pcm files, and microsoft ima/pcms do not work in trespasser, therefore tpa_reader does not allow you to convert them into a .cau file for import.
All right. Everything's working now. The sounds are playing fine in-game. I just thought that since I could see the names of the sounds when looking in other .tpas, I would be able to see them in mine. It just shows: "missing" Although the sounds still play just fine. :)
Check out the HL2 mod I'm helping with: Image
Visit my Steam! http://steamcommunity.com/id/awesome24712/
Visit my YouTube! http://www.youtube.com/user/awesome24712

Post benchamrks:
1 [x] 2 [x] 4 [x] 8 [x] 16 [x] 32 [x] 64 [x] 128 [x] 256 [x] 512 [x] 1024 [ ] 2048 [ ] 4096 [ ] 9192 [ ]
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: pcm encoder

Post by Rebel »

awesome24712 wrote:
Rebel wrote:Well, if you're using tpa_reader, type in the stringname & any caption data you want assigned to the wave before you import the .cau file into the .tpa. There's a complete help file with the program, just hit the ? button, or go into the readers folder to access the hhp file directly. Note: you can only encode pcm files, and microsoft ima/pcms do not work in trespasser, therefore tpa_reader does not allow you to convert them into a .cau file for import.
All right. Everything's working now. The sounds are playing fine in-game. I just thought that since I could see the names of the sounds when looking in other .tpas, I would be able to see them in mine. It just shows: "missing" Although the sounds still play just fine. :)
Your new stringnames can be found inside the reader's log files, awesome. Look thru the help file, it'll tell you how to add your new crc values so they can be picked up by the reader.
User avatar
awesome24712
Pteranodon
Pteranodon
Posts: 889
Joined: Sun Oct 02, 2011 1:56 am
Antispam: No
Location: USA
Contact:

Re: pcm encoder

Post by awesome24712 »

Rebel wrote:
awesome24712 wrote:
Rebel wrote:Well, if you're using tpa_reader, type in the stringname & any caption data you want assigned to the wave before you import the .cau file into the .tpa. There's a complete help file with the program, just hit the ? button, or go into the readers folder to access the hhp file directly. Note: you can only encode pcm files, and microsoft ima/pcms do not work in trespasser, therefore tpa_reader does not allow you to convert them into a .cau file for import.
All right. Everything's working now. The sounds are playing fine in-game. I just thought that since I could see the names of the sounds when looking in other .tpas, I would be able to see them in mine. It just shows: "missing" Although the sounds still play just fine. :)
Your new stringnames can be found inside the reader's log files, awesome. Look thru the help file, it'll tell you how to add your new crc values so they can be picked up by the reader.
Ahh... help files. Where would we be without them? I think I read it earlier when I was failing to convert them, I guess I didn't read them closly enough. Thanks for adding that little file. :wink: TPA_reader shows me the names of the sounds. Just to prove I'm not lying, here's a screenshot:
Spoiler: show
Image
An $Name! Thanks for the help, Rebel. :)
Check out the HL2 mod I'm helping with: Image
Visit my Steam! http://steamcommunity.com/id/awesome24712/
Visit my YouTube! http://www.youtube.com/user/awesome24712

Post benchamrks:
1 [x] 2 [x] 4 [x] 8 [x] 16 [x] 32 [x] 64 [x] 128 [x] 256 [x] 512 [x] 1024 [ ] 2048 [ ] 4096 [ ] 9192 [ ]
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: pcm encoder

Post by Draconisaurus »

Rebel wrote:if mono;

22050, 16bit, 1024 block alignment


stereo;

41000, 16bit, 2048 block alignment
Soooo I grabbed tpas_pcm-encoder.zip Version: 1.0 and did a test sound of about 10 seconds with a human voice. Ingame result is absolutely awful. I am using Audacity... Got the 22050 and 16 bit specified, however there was nothing about setting block alignment. Recorded in mono. Help?
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: pcm encoder

Post by machf »

Why don't you just use TPAreader?

Or EffectsEditor?
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
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: pcm encoder

Post by Rebel »

Drac, it's been yeas since I messed with this, but I think you're going about this all wrong. Record
the voice in 44000 16bit stereo, then decoding that wav will put it into a tres compatible wav. So,
save your wave in 44000 16bit stereo/ima/dvi format, then decode.

Or, do as machf suggested and us the Effects Editor -

@Edit: Block alignments I may have mentioned in read me files is meant as additional information
for anyone who wanted to alter the program's code. Industry standard is 1024/2048, no other program
out there saves for trespasser's block alignments, except of course the Effects Editor.
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: pcm encoder

Post by Draconisaurus »

Erm. Few options to play around with.

I tried the stereo format option. The encoding app of yours proceeds to tell me that it doesn't do stereo.

Also, what do we use around here to create CAU files for sounds not already in a TPA file?

And in general I'm unsure how to use EffectsEditor.
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: pcm encoder

Post by Rebel »

Drac, below are the instructions included within encoder and decoder:

Encoder setup for trespasser use. Only mono, 22050 sample_rate .pcm waves can
be encoded into ima/dvi adpcms. If you have a stereo (44100 sample_rate) you
wish to encode, first convert it to single channel, 22050, then encode to ima/
dvi adpcm format.

The encoded waves are still not perfect, but they sound good enough to import
& use in_game. Much better than the original encoder released earlier - I al-
so took a temp_pcm wav (was a converted stereo to mono, 22050 for player use),
encoded and imported that and the music sounded quite good. :)


Reb.

Useage: Drag n' drop utility. Decodes ima/dvi adpcm (format 20) to standard
pcm wave.

Sample_rates: Code assumes mono as 22050 & stereo as 44100. Whether stereo
or mono, current code outputs mono, pcm wave. (The two sample_rates are the
only frequencies dealt with, so reading & writing out individual headers was
not needed -

The decoder class was searched out to decode the game trespasser's odd_ball
block alignment of 1028/2056. Although windows environment can play ima/dvi
waves natively, it does require standard block alignments of 512/1024. Thus,
looking to play the waves inside my audio program that was written to access
the game's packed audio files, I was lured into this decoding process -


Code is included, the ima class is courtesy of J.d. Medhurst (aka tixy). The
remainder of the mess is mine. Feel free to change the code in whatever way
you'd like, tailor it to meet your own needs. Hopefully, the next person to
require doing this sort of thing won't go insane looking for the solution -


Reb.

As for creating cau files, tpareader does that. The how to should be in the help
files. I'm pretty sure it's not complicated, but I can't remember the control layout.
It's just been too long for my feeble mind to recall -
Post Reply