Sound error

i get this error everytime i try to play my .ogg file (i made sure it was vorbis codec)

INFO:DLIB: Log server started on port 53401
INFO:ENGINE: Target listening with name: goofyahhdevice - fe80::f833:d83a:f74d:38b1 - Windows
INFO:ENGINE: Engine service started on port 53402
INFO:GRAPHICS: Initialised graphics device ‘opengl’
INFO:ENGINE: Defold Engine 1.6.0 (d9e9c49)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:LIVEUPDATE: Could not find base .arci/.arcd. Liveupdate disabled
INFO:ENGINE: Initialised sound device ‘default’
ERROR:SCRIPT: main/trolley script.script:1: Could not send message ‘play_sound’ from ‘:’ to ‘:/assets/war game sfx/trolly.ogg’.
stack traceback:
[C]:-1: in function post
main/trolley script.script:1: in main chunk

WARNING:RESOURCE: Unable to create resource: /main/trolley script.scriptc: FORMAT_ERROR
WARNING:RESOURCE: Unable to create resource: /_generated_4b842244.goc: FORMAT_ERROR
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /_generated_4b842244.goc.
WARNING:RESOURCE: Unable to create resource: /main/main.collectionc: FORMAT_ERROR

its for a trolly, i want it to play every time you touch the trigger, and i was testing just doing the sound itself first though

I’m new to this, but I had an error with my wav file…it was higher bitrate than defold likes. But the error was pretty specific so I immediately just down sampled it and it worked. Maybe something like this with ogg. try a 44,100 wav file and see if it works.

how would i do that?

You haven’t shared any code, but I’m guessing you wrote something like this:

sound.play("/assets/war game sfx/trolly.ogg")

This won’t work since in Defold all sounds must be played through a sound component and not a .ogg or .wav file directly. There’s a section in the manual that goes into detail about setting that up:

4 Likes