Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Apr 18, 2024 9:12 pm
All times are UTC + 0
Compress Files on audio.bag
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [7 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
deathreaperz
Commander


Joined: 20 May 2013
Location: Indonesia

PostPosted: Sat Feb 04, 2017 9:42 am    Post subject:  Compress Files on audio.bag Reply with quote  Mark this post and the followings unread

Hello, guys

Is there any way to compress .wav files on audio.bag?

I reassembled/ordered my original audio.bag (since the alphabet isn't in a right order + cleaning up my mod's sound files and place them to the audio01.bag) and it lose it's compress.
I compared with the original audio.bag with my reassembled/ordered original audio.bag, the Flags and the Chunk Size on XCC Audio Editor is different until I think that affects the non-compressing bag. Even my audio01.bag didn't compress too.

Any solution for this?

_________________
Quote:
Humans were born for two things: to pray and be productive.


Back to top
View user's profile Send private message
IamInnocent
Rocket Infantry


Joined: 28 Dec 2010
Location: East Malaysia

PostPosted: Sat Feb 04, 2017 10:01 am    Post subject: Reply with quote  Mark this post and the followings unread

Maybe using Audacity to import and export the wav files again. The audio files should be in 16 PCM format, being it 22050Hz, 44000Hz or 48000Hz.

Edit: You can also try to change the name of audio01.bag to audio.bag for compression, then change the file name again to see if it works.

Alternatively if you are using Ares, the sounds dont have to be in bag files anymore. You can just compile the files in a .mix file.

http://ares-developers.github.io/Ares-docs/new/misc/looseaudiofiles.html

_________________



Back to top
View user's profile Send private message
deathreaperz
Commander


Joined: 20 May 2013
Location: Indonesia

PostPosted: Sat Feb 04, 2017 1:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks! Surprised

_________________
Quote:
Humans were born for two things: to pray and be productive.


Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Sat Feb 04, 2017 1:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

First of all, everyone can safely ignore IAmInnocent's sorry attempt at giving advice above, it's just inaccurate and irrelevant information.

Secondly, game primarily supports two types of wave file encoding, PCM and IMA ADPCM. You can distinguish between these in XCC Sound Editor via the Flags field, with the most common (and only ones in vanilla game) values being

6   = 16-bit PCM, 1 channel
7   = 16-bit PCM, 2 channels
12 = 4-bit IMA ADPCM, 1 channel
13 = 4-bit IMA ADPCM, 2 channels

The important thing to note here is that Extract functionality in XCC Sound Editor ALWAYS converts your files to 16-bit PCM regardless of their original format - which is what caused the issue you are having right now. Even more than that, it will not extract stereo-channel audio correctly at all, meaning that the several stereo-channel sounds that might have been in your old audio.bag are now corrupted, or more accurately, cut in half.

As for what's the difference between PCM and IMA ADPCM, latter takes more or less one quarter the space former does. It is a lossy encoding, but when the alternative is bloating your mod's size and choking the game's sound buffer with uncompressed audio, it's definitely the way to go.

TL;DR: Best approach is to just add your own additional/edited sound files in IMA ADPCM format in audio01.idx/bag (or loose if you insist but it is possible that idx/bag combination offers better performance) and leave vanilla game's bag untouched.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat Feb 04, 2017 1:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

IamInnocent, he wants compression and you advice pcm...

Ah since Starkku cleared this up, I will just add you can use about any hz here from 8000-88200khz if wish but filesize wise its optimal to stay with 22/44khz. Channels wise only stereo at highest is supported.

Back to top
View user's profile Send private message
IamInnocent
Rocket Infantry


Joined: 28 Dec 2010
Location: East Malaysia

PostPosted: Sat Feb 04, 2017 1:48 pm    Post subject:   Reply with quote  Mark this post and the followings unread

Lol, sorry for my unprofessional conduct.  Razz  Guess you do learn something new everyday.

But if Starkku's right, then your audio.bag is corrupted and just leave it untouched.

Offtopic: If I recall correctly, I encountered a problem with loading too many sounds into the audio.bag, leaving the file broken.

It's best that you do not leave audio.bag too big, or to compile too many sounds into the the file at once.

_________________



Back to top
View user's profile Send private message
deathreaperz
Commander


Joined: 20 May 2013
Location: Indonesia

PostPosted: Sat Feb 04, 2017 3:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Starkku's solution did compressed the file!

Thanks everyone for trying to help!

_________________
Quote:
Humans were born for two things: to pray and be productive.


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1442s ][ Queries: 11 (0.0083s) ][ Debug on ]