Describe the bug (REQUIRED)
I am writing a logic to play a sound after a trigger collision type. The sound format is .wav type as required. However as soon as the trigger hits, the game crashes writing the crash report to file. I am not mentioning code here as it is a straight forward call, I shall link the project repo.
To Reproduce (REQUIRED)
Steps to reproduce the behavior:
The repo has the code and currently interacting with other fishes will trigger the issue.
Expected behavior (REQUIRED)
I was expecting the sound to play without any issues.
Defold version (REQUIRED):
Platforms (REQUIRED):
Minimal repro case project (OPTIONAL):
This is the branch with current feature added
Logs (OPTIONAL):
INFO:CRASH: Successfully wrote Crashdump to file: /home/nevin/.Defold/_crash
The crash report:
��1.2.1705791ee6d96b87e50eee5acd70abaa4026fefef28Linux5.3.0-59-genericenenINdmenginelibXdmcp.so.6.0.0libXau.so.6.0.0libbsd.so.0.8.7libasound.so.2.0.0libGLdispatch.so.0.0.0libGLX.so.0.0.0libxcb.so.1.1.0librt-2.27.solibsndio.so.6.1libc-2.27.solibgcc_s.so.1libm-2.27.solibstdc++.so.6.0.25libdl-2.27.solibpthread-2.27.solibGLU.so.1.3.1libGL.so.1.0.0libX11.so.6.3.0libopenal.so.1.18.2ld-2.27.so�?�U��]1�]PQ�]�r�]��]pμ]���]�]�4�]�U�]���]��]���]�(�]�H�]�j�]���]`��]���]��]
/�?�U��I�]/home/nevin/.Defold/unpack/c08d752f41f670e57c28a238ad8e7eecdfc27833/x86_64-linux/bin/dmengine(+0x2f2f07) [0x55c33fbe2f07]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f5dbe49e890]
Additional context (OPTIONAL):
I am suspecting if this bug is because of additional system sound modules.
Short version: You accidentally tried to play a 24bit sound, while we only support 16bit sounds.
Doc: https://defold.com/manuals/sound/?q=_wave_#creating-a-sound-component
I'm looking into a way to make this into a build error, to catch the error earlier.
Really missed that point in the docs. I guess it solves my problem, but like you mentioned it will be better for devs to understand.
For now, I fixed the (broken) check for the formats at runtime:
ERROR:SOUND: Only mono/stereo with 8/16 bits per sample is supported (/assets/sounds/eat.wavc): 24 bpp 2 ch
This should make it clearer to pinpoint the error.