Driver doesn't support sample playback

Hello everyone! I recently tried the new “Sample” feature of Godot out, and while my short SFX all work, it seems that my background music just refuses to play with the following error:
W 0:00:01:0011 start_sample_playback: Trying to play stream (-9223371993435339326) as a sample (-9223371995196947064), but the driver doesn't support sample playback.

Honestly, I have no idea what I have done wrong. The stream is just a simple MP3:
grafik

Could it be that maybe the file is just too big (288 seconds)? But I haven’t found anything about a length restriction in the docs nor in the blog post discussing the audio changes.

I am on v4.3.stable.official [77dcf97d8].
My system info in case that’s needed: Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4070 Ti SUPER (NVIDIA; 32.0.15.6094) - AMD Ryzen 9 7900X3D 12-Core Processor (24 Threads)

3 Likes

Hey - old post but I’m receiving the same error on all FX when I try and use samples and this is the only relevant result Google gives me…

Did you/anyone get anywhere with this? I don’t believe it’s an issue local to my machine since I have no audio playback when I publish to web and run on other devices either.

I am not sure about what exact “Sample” feature the original post mentions, but error message explains the problem, that the stream cannot be played as sample.
In godot (and in most other cases), mp3 format will be treated as streamed audio and used for background music and long ambient sounds etc.
For sound effects (samples), you want to use uncompressed wav format. So if your sound effects are compressed in mp3 or ogg format, they need to be converted to wav, otherwise godot will mark them as stream.
Hope this info helps. Without more context, it’s mostly a guess based on experience.

The sample feature being referred to is explained in this article here.

Audio streams don’t play nicely with web browsers, and samples are the solution - however following the approach in the linked article doesn’t appear to work (have tried in both 4.3 and 4.4 and get the same ‘driver’ error).

2 Likes

I just tested it out again, and it seems the error only appears when running natively (tested on windows and linux). If I export the same project to web, it works fine.
I think leaving the playback type on “default” is the best course of action. This way, Godot uses “Samples” when exporting to web and “Stream” for anything else. I guess “Samples” isn’t supposed to work on anything other than web in the first place?
Converting to different file formats had no effect whatsoever for me.

Interesting read. Newer knew that godot abandoned samples in version 3 (that’s a big no-no in my book). Almost in all game engines and frameworks that i tried it was always “streams for music”, “samples for sound effects”, and sometime i was able to choose to preload big audio files as samples. Forcing all audio to be streams is a bad idea, in my opinion.
I was not aware that the problem was with web export. Still think that the it can be solved with tweaking audio formats. Maybe convert all sound to compressed, like ogg. Or make sure that all sounds match frequency (44kHz or 48kHz). Just throwing ideas, considering that there is a lot of web versions of games made in godot and everything works fine.

Okay - for anyone that ends up in the same place I did…

  • Sample playback should seemingly never work when running via the editor, but should work in a browser. I was assuming that because samples did not work via editor, the same thing was causing silence in the browser; not the case.
  • My issue was actually caused by the difference in file system when running exported for web - I was iterating through .wav files to load them as resources, but these do not exist once exported. Good explainers here and here.

Quite a simple problem once I knew the driver error is a red herring - not sure that it is made explicit anywhere that even though there’s the option to use samples as the default playback option even outside web, this will probably never work (at least, not on either of my two laptops anyway).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.