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 Fri Apr 19, 2024 6:46 pm
All times are UTC + 0
RA2 music
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [14 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
amitakartok
Vehicle Driver


Joined: 03 Jul 2009

PostPosted: Sat Oct 27, 2012 11:00 pm    Post subject:  RA2 music Reply with quote  Mark this post and the followings unread

Question 1: exactly what bitrates can the engine play? The relevant tutorial on ModEnc states it requires 22,050 kHz mono but I got it to play a 48,000 kHz stereo one without errors or crashes.


Question 2: am I allowed to overwrite the original filenames in a modded theme.ini without breaking campaign compatibility, ie. if I change the filename and theme.ini name of a music file, will it crash the game when a campaign map is scripted to start playing the file that used to occupy the same line in theme.ini? Example: third Soviet YR mission is scripted to start playing Defend the Base when the dominator is revealed; how does the game invoke the song? By filename or does it assign an index to each file according to their order in theme.ini and invokes that index? If the latter is the case, I can theoretically modify the entries however I want and it won't crash unless the entry is invalid, right?

I know the filenames aren't hardcoded or it wouldn't even be possible to add new entries.

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


Joined: 28 Dec 2007
Location: Finland

PostPosted: Sat Oct 27, 2012 11:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

1:
Any PCM (8 or 16-bit) or IMA ADPCM wave audio files are OK as far as I know. I recommend using stereo channel IMA ADPCM with sample rate of either 22050, 32000 or 44100hz (depending on quality requirements) for music. PCM waves take pretty much four times the space that IMA ADPCM ones do.

2.
Maps do not refer to music themes using filenames, but via [Themes] list indices (map trigger action 'Play music theme') or via the ID specified in theme(md).ini (Theme flag under map [Basic] section, which tells game to play this particular track at the start of the scenario. Used in YR Allied mission #1 to always play track named 'Deceiver' at the beginning).

So yes, you can change the filenames the track refer to, but re-ordering the list or altering the ID's might break some stuff. Possibly only making it so that it plays wrong track or nothing at all. I haven't really tested if either of those two scenarios causes a crash (referring to missing track ID via Theme= and using invalid index number for 'Play theme' action), but it's possible and in the case of trigger action, I'd say it's even likely.

_________________

Last edited by Starkku on Sat Oct 27, 2012 11:33 pm; edited 3 times in total

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


Joined: 03 Sep 2004
Location: Czechia

PostPosted: Sat Oct 27, 2012 11:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

If trigger refers to a theme that doesn't exist in the [Themes] list, the game will crash indeed.

_________________
mentalomega.com

Back to top
View user's profile Send private message Send e-mail Visit poster's website YouTube User URL Facebook Profile URL Twitter Channel URL
amitakartok
Vehicle Driver


Joined: 03 Jul 2009

PostPosted: Sat Oct 27, 2012 11:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

So let's take this example:

Code:
[INTRO]
Name=THEME:Intro
Sound=Grinder


From what I can tell, Sound is the filename sans extension and Name is the line displayed in the playlist, lifted from the string table (ra2.csf). If I change the filename, put the new name into the Sound line and finally modify the contents of the THEME:Intro string (but not the string's name), it won't break anything?

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


Joined: 28 Dec 2007
Location: Finland

PostPosted: Sat Oct 27, 2012 11:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

amitakartok wrote:

From what I can tell, Sound is the filename sans extension and Name is the line displayed in the playlist, lifted from the string table (ra2.csf). If I change the filename, put the new name into the Sound line and finally modify the contents of the THEME:Intro string (but not the string's name), it won't break anything?


Yep, that would be the filename without extension. And no, it won't break anything. You don't really even have to change the string entry, because you don't see it anywhere for the main menu track (which is what INTRO is). And you can change the string name in theme(md).ini without breaking anything either, really. You just need to add a new string into ra(md).csf for it then.

_________________

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


Joined: 03 Jul 2009

PostPosted: Sun Oct 28, 2012 12:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Awesome! Then I'm not working for nothing...

[quote=Starkku]Any PCM (8 or 16-bit) or IMA ADPCM wave audio files are OK as far as I know.[/quote]

Not so; I once tried signed 16-bit Windows PCM via Audacity and the file got a deafeningly loud overlay of white noise in-game. Sounded fine in XCC, though; when I converted the same file to IMA ADPCM, it played fine in-game but stutters like crazy in XCC. Strange.

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


Joined: 28 Dec 2007
Location: Finland

PostPosted: Sun Oct 28, 2012 12:22 am    Post subject: Reply with quote  Mark this post and the followings unread

amitakartok wrote:

Not so; I once tried signed 16-bit Windows PCM via Audacity and the file got a deafeningly loud overlay of white noise in-game. Sounded fine in XCC, though; when I converted the same file to IMA ADPCM, it played fine in-game but stutters like crazy in XCC. Strange.


I stand corrected. PCM music requires sample rate of 22050hz. It's something I've heard of before but I just probably forgot it. This limitation does not apply to sound effects which might've also confused me for a moment there. I don't think anybody should be using PCM waves for music anyways so it's not really a big issue if you ask me.

_________________

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


Joined: 03 Jul 2009

PostPosted: Sun Oct 28, 2012 12:25 am    Post subject: Reply with quote  Mark this post and the followings unread

I wrote in the first post I got the game to play a 48,000 kHz music file, yet you say that should be possible for sound effects only. You mean that limitation doesn't apply to ADPCM? I'm getting confused over here.

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


Joined: 28 Dec 2007
Location: Finland

PostPosted: Sun Oct 28, 2012 12:28 am    Post subject: Reply with quote  Mark this post and the followings unread

amitakartok wrote:
How? I wrote in the first post I got the game to play a 48,000 kHz music file, yet you say that should be possible for sound effects only. I'm getting confused over here.


Because I forgot one word.

Starkku wrote:
I stand corrected. PCM stereo music requires sample rate of 22050hz.


If you got 48khz two-channel PCM track to play, then your game is behaving differently from mine for whatever reason. IMA ADPCM music works regardless of whether or not it's mono/stereo and sample rate.

_________________

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


Joined: 03 Jul 2009

PostPosted: Sun Oct 28, 2012 12:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh. Oh, I get it now. Thanks for clearing that up.

Back to top
View user's profile Send private message Skype Account
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sun Oct 28, 2012 5:58 am    Post subject: Reply with quote  Mark this post and the followings unread

It's an interesting thing that indeed 48khz stereo PCM wav music wise not play and same applies for 44khz and 32khz as well, possibly related to wav size getting too large, maybe some kinda memory handling or something at work there but sound sfx wise, the engine is capable of playing any khz as high as 88200khz has been tested but music wise, IMA is advisable size wise despite some quality loss.

Back to top
View user's profile Send private message
DarkVen9109
Pyro Sniper


Joined: 02 Nov 2012
Location: Philippines

PostPosted: Sun Nov 25, 2012 3:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Do you guys use Audacity when you're planning to convert one audio file or RAD video tools?

Back to top
View user's profile Send private message Send e-mail
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Sun Nov 25, 2012 10:49 am    Post subject: Reply with quote  Mark this post and the followings unread

dBpoweramp is what I use for that. Audacity is IMO overkill for a conversion.

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Cranium
Defense Minister


Joined: 05 Dec 2009
Location: USA

PostPosted: Sun Nov 25, 2012 4:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

i use and find WinAmp to be user friendly. But believe it or not little ole' windows sound recorder does a fantastic job of converting and saving sound files as well, Wink

_________________

The enemy shall be injected with toxic poison - Venom

Back to top
View user's profile Send private message Visit poster's website Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [14 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.2064s ][ Queries: 11 (0.0093s) ][ Debug on ]