unable to resolve SF::Sound (also SF::Music)
freeze-dolphin opened this issue · comments
Sapphira Tempest commented
Oleh Prypin commented
Need to require "crsfml/audio", that's probably what's missing
Sapphira Tempest commented
Thanks, it works.
But now another problem comes into being... xd
This is my code:
def play(audio : String,
volume : Float64,
loop? : Bool = false)
if loop?
music = SF::Music.new
music.open_from_file audio
music.volume = volume * 100
music.loop = true
music.play
else
sound = SF::Sound.new SF::SoundBuffer.from_file audio
sound.volume = volume * 100
sound.play
end
end
and here is the runtime error:
freeze-dolphin@nebula:~/Documents/vscode-workspace/arcaea-inspector$ shards run -- -o /home/freeze-dolphin/Documents/arcaea_4.0.255c_assets/app-data/story/vn/epilogue_last_zh-Hans.vns
Dependencies are satisfied
Building: arcaea-inspector
Executing: arcaea-inspector -o /home/freeze-dolphin/Documents/arcaea_4.0.255c_assets/app-data/story/vn/epilogue_last_zh-Hans.vns
AL lib: (EE) alc_cleanup: 1 device not closed
freeze-dolphin@nebula:~/Documents/vscode-workspace/arcaea-inspector$
And no sound was played
My operating system: Ubuntu 22.04 LTS, GNOME 42.2, Wayland
Sapphira Tempest commented
It seems like to be a concurrent-related topic..
posted on crystal forum: https://forum.crystal-lang.org/t/concurrency-related-problem/4808