As a code type of programmer I like to create code to get things done. Now I want play sounds and I create a SampleLibrary a SamplePlayer to the sounds.
With streaming it will work fine (see test1)
func test1():
var player = StreamPlayer.new()
player.set_stream(load("res://assets/music/intro.ogg"))
player.set_loop(true)
player.play()
func test2():
var lib = SampleLibrary.new()
lib.add_sample("select", load("res://assets/sound/select.ogg"))
var playerFx = SamplePlayer2D.new()
playerFx.set_sample_library(lib)
playerFx.play("select")
In test2 I get an error: Condition p_sample.is_null() is true on the lib.add_sample
the file will load from disk and the file is ok.
can someone help me with this?