MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / postProcessAudio

Method postProcessAudio

source/base/StarAssets.cpp:1340–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1338}
1339
1340shared_ptr<Assets::AssetData> Assets::postProcessAudio(shared_ptr<AssetData> const& original) const {
1341 return unlockDuring([&]() -> shared_ptr<AssetData> {
1342 if (auto audioData = as<AudioData>(original)) {
1343 if (audioData->audio->totalTime() < m_settings.audioDecompressLimit) {
1344 auto audio = make_shared<Audio>(*audioData->audio);
1345 audio->uncompress();
1346
1347 auto newData = make_shared<AudioData>();
1348 newData->audio = audio;
1349 return newData;
1350 } else {
1351 return audioData;
1352 }
1353 } else {
1354 return {};
1355 }
1356 });
1357}
1358
1359void Assets::freshen(shared_ptr<AssetData> const& asset) const {
1360 asset->time = Time::monotonicTime();

Callers

nothing calls this directly

Calls 2

uncompressMethod · 0.80
totalTimeMethod · 0.45

Tested by

no test coverage detected