Skip to content

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Nov 14, 2025

This greatly reduces PCK size for dedicated servers in projects that use audio in WAV, Ogg Vorbis and MP3 formats. Additionally, this prevents errors from being printed on export when using --headless to export a dedicated server PCK in a project that uses a VoxelGI node.

Testing project: test_dedicated_server_export_2.zip

Preview

File sizes are in bytes. The test project includes 3 short sound files (2.25s each): one WAV, one Ogg Vorbis and one MP3 sound.

Before this PR, both PCK/ZIPs would be the same size as the project doesn't include any textures.

PCK size

194216 /tmp/out.pck
  7228 /tmp/out_server.pck

ZIP size

172691 /tmp/out.zip
  6283 /tmp/out_server.zip

TODO

  • Fix audio playback length not being respected. In the current implementation, the playback position never advances, which means AudioStreamPlayer never emits the finished signal. We want this signal to be emitted at the right time just like in a standard build, as it may be relied upon server-side for gameplay purposes.
    • Before I had mix() implemented (returning -1 instead), it made AudioStreamPlayer emit its finished signal instantly instead.
    • I'm not sure how to implement this in the simplest way, while still respecting loop mode/loop begin/loop end (as these properties affect when the finished signal is emitted). The AudioStreamPlayer's playback_speed property should also be respected, as well as manual seeking.
  • Change loop_begin and loop_end to be stored in seconds as opposed to samples, as there's no concept of samples in PlaceholderAudioStream (we don't store the sound's original sample rate).

@Calinou Calinou force-pushed the audiostream-add-placeholder branch from f84ecea to b507a06 Compare November 14, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip audio from dedicated server exports to reduce PCK size

1 participant