Custom sound in my map Created 8 years ago2016-06-06 12:11:25 UTC by seedee seedee

Created 8 years ago2016-06-06 12:11:25 UTC by seedee seedee

Posted 8 years ago2016-06-06 12:11:25 UTC Post #330357
I want to use a custom sound in my map. The file size is 31.0 MB and the length is 3 minutes 5 seconds. Is there an engine limit on file size/length? I need to know this, and any way to reduce the file size.
Posted 8 years ago2016-06-06 13:07:16 UTC Post #330358
You can play a .mp3 or a .wav

For an mp3 it will have to take the place of one of the music tracks from the original game, you can read here:
http://twhl.info/wiki.php?id=161

For a .wav, you'll want to use an ambient generic and stick to 22,000 HZ 8 bit Mono format:
http://twhl.info/wiki.php?id=122

As for length, there may be a limit, I've never tried anything that long. Give it a shot, if there is, you'll have to split it up into smaller chunks.

Something to note - sometimes you can get audio not coming back after loads from saves, so if you have a track that long, depending on your situation, you might run into trouble there.
Posted 8 years ago2016-06-06 15:04:39 UTC Post #330359
31MB for one sound file in a map is ridiculous!

If it is a music track, then replace one of the existing mp3 files used by Half-Life, but this would only work for a mod. You don't want to go overwriting everyone's base game files and you'd get a well deserved back lashing if you did.

For a single map within Half-Life, you could use a .wav and an ambient_generic entity, but then you have two problems.

First, not everyone wants to hear the same music as you. If it's an ambient generic, they can't lower the volume or turn it off without affecting every other sound in the map.

Second, the quality would be horrendous. You'd also get the directional issue where the player would only hear it in the left or right speaker depending on their position in the map.

Long story short: Don't add music to maps, only mods.
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-06-06 15:36:38 UTC Post #330360
Not having the audio come back from a save is caused from the "not looped" flag being checked.
Posted 8 years ago2016-06-07 11:00:40 UTC Post #330367
You'd also get the directional issue where the player would only hear it in the left or right speaker depending on their position in the map.
Partially true.
To get rid of this I place multiple ambient_generics on the respective angles and sides of the map to achieve some sort of surround sound, or just creating hollowed NULL/BEVEL brushes with an ambient_generic inside them, put them outside the map in a correct distance between them creating a square form around the map. Though the volume must be lowered a bit otherwise it gets "mixed" (somehow), and everything should be played everywhere (no short, medium or long distance checkboxes whatsoever).

Works pretty good. Still better than having just one of them.
Alberto309 Alberto309weapon_spaghetti
Posted 8 years ago2016-06-07 13:39:00 UTC Post #330369
Yeah, we used to resort to that hacky fix. We had a developer fix it. :P
monster_urby monster_urbyGoldsourcerer
You must be logged in to post a response.