Remix.run Logo
duskwuff 4 days ago

> The point is that playback of uncompressed audio is indeed cheaper than playback of compressed audio.

Even when Titanfall 2 was released in 2016, I don't think that was meaningfully the case. Audio compression formats have been tuned heavily for efficient playback.

maccard 3 days ago | parent | next [-]

It's easy to apply todays standards. Titanfall was released 11 years ago, and ran on an Xbox 360, and a Core 2 Duo. MP3 was a patent encumbered format. There's a fun DF article [0] where they say:

> Titanfall accesses Microsoft's existing cloud network, with servers spooling up on demand. When there's no demand, those same servers will service Azure's existing customers. Client-side, Titanfall presents a dedicated server experience much like any other but from the developer and publisher perspective, the financials in launching an ambitious online game change radically.

Things changed _massively_ in games between 2014 and 2017 - we went from supporting borderline embedded level of platforms with enormous HW constraints, architecture differences, and running dedicated servers like the 90's, to basically supporting fixed spec PCs, and shipping always online titles running on the cloud.

[0] https://www.digitalfoundry.net/articles/digitalfoundry-2014-...

nearbuy 4 days ago | parent | prev | next [-]

Uncompressed audio is typically used for sound effects, while music is compressed. Latency is the primary benefit. Uncompressed audio will play immediately while an mp3 will have a few frames delay. Sounds like gunshots or footsteps are typically short files anyway, so the increased memory usage isn't that painful.

Games also can stack many sounds, so even if the decoding cost is negligible when playing a single sound, it'll be greater if you have 32 sounds playing at once.

duskwuff 4 days ago | parent [-]

> Uncompressed audio will play immediately while an mp3 will have a few frames delay.

I'm not sure what you mean by this. Encoding latency is only relevant when you're dealing with live audio streams - there's no delay inherent to playing back a recorded sound.

> Sounds like gunshots or footsteps are typically short files anyway, so the increased memory usage isn't that painful.

Not all sound effects are short (consider e.g. loops for ambient noise!), and the aggregate file size for uncompressed audio can be substantial across an entire game.

nearbuy 4 days ago | parent [-]

> there's no delay inherent to playing back a recorded sound.

There absolutely is. You can decompress compressed audio files when loading so they play immediately, but if you want to keep your mp3 compressed, you get a delay. Games keep the sound effects in memory uncompressed.

> Not all sound effects are short

Long ambient background noises often aren't latency sensitive and can be streamed. For most games textures are the biggest usage of space and audio isn't that significant, but every game is different. I'm just telling you why we use uncompressed audio. If there is a particular game you know of that's wasting a lot of space on large audio files, you should notify the devs.

There is a reason both Unity and Unreal use uncompressed audio or ADPCM for sound effects.

justsomehnguy 4 days ago | parent [-]

> but if you want to keep your mp3 compressed, you get a delay

If that really bothers you then write your own on-disk compression format.

> why we use uncompressed audio

> ADPCM

... which is a compressed and lossy format.

nearbuy 4 days ago | parent | next [-]

> If that really bothers you then write your own on-disk compression format.

Why? What are you trying to solve here? You're going to have a hard time making a new format that serves you better than any of the existing formats.

The most common solution for instant playback is just to store the sound uncompressed in memory. It's not a problem that needs solving for most games.

ADPCM and PCM are both pretty common. ADPCM for audio is kinda like DXT compression for textures: a very simple compression that produces files many times larger than mp3, and doesn't have good sound quality, but has the advantage that playback and seek costs virtually nothing over regular PCM. The file sizes of ADPCM are closer to PCM than mp3. I should have been clearer in my first comment that the delay is only for mp3/Vorbis and not for PCM/ADPCM.

There isn't a clean distinction between compressed and uncompressed and lossy/lossless in an absolute sense. Compression is implicitly (or explicitly) against some arbitrary choice of baseline. We normally call 16-bit PCM uncompressed and lossless but if your baseline is 32-bit floats, then it's lossy and compressed from that baseline.

justsomehnguy 4 days ago | parent [-]

> Why? What are you trying to solve here? You're going to have a hard time making a new format that serves you better than any of the existing formats.

Storage space. But this is the way for the same guys who duplicate 20Gb seven times 'to serve better by the industry standard'.

More sane people would just pack that AD/PCM in a .pk3^W sorry in a .zip file (or any other packaging format with LZ/7z/whatever compatible compression method) with the fastest profile and would have the best of the both worlds: sane storage requirements, uncompressed in memory. As a bonus it would be loaded faster from HDD because a data chunk which is 10 times smaller than uncompressed one would be loaded surprise 10 times faster.

danbolt 4 days ago | parent | prev [-]

Within the scope of a game’s production, the programmer time spent dogfooding the new audio format can be used towards something else that improves the value of the end product.

The uncompressed audio for latency-sensitive one-shots usually isn’t taking up the bulk of memory either.

justsomehnguy 2 days ago | parent [-]

> programmer time spent dogfooding the new audio format can be used towards something else that improves the value of the end product

Like exploring the 'widely accepted industry practices' and writing code to duplicate the assets, then writing the code to actually measure what it did what the 'industry practices' advertised and then ripping this out, right?

And please note what you missed the 'if it really bothers you'.

ycombinatrix 4 days ago | parent | prev [-]

I think GP was confused - Titanfall 1 from 2014 is the one with the massive volume of uncompressed audio. Though I think your point still stands.

I was trying to point out that the decision to compress or not compress audio likely has nothing to do with the download size.