Open konsumer opened 1 year ago
I don't see how this wrapper would have ever worked, but I got mine starting to work. all the types that are ptr Name
should be Name
for example:
proc Soloud_init*(aSoloud: ptr Soloud): cint
should be
proc Soloud_init*(aSoloud: Soloud): cint
because Soloud
is already a pointer (so ptr Soloud
would be a pointer to a pointer):
type
Soloud* = pointer
Here is a working example:
import unittest
import soloud
import os
test "setup":
var sl = Soloud_create()
discard Soloud_init(sl)
Soloud_setGlobalVolume(sl, 3.0)
var speech = Speech_create()
discard Speech_setText(speech, "Hello")
discard Soloud_play(sl, speech)
while Soloud_getVoiceCount(sl) > 0:
sleep(100)
I definitely need to test a lot more, but it seems to be the start of things working.
I know it's been a while, but I am also trying to wrap soloud in nim, and got similar output with
c2nim
. I keep gettingIllegal storage access. (Attempt to read from nil?)
when I try toSoloud_play()
.I get similar with your example, using your wrap of soloud. Did you ever get this working? Am I missing some steps?
My full wrapper is here. Main difference is that I inline soloud with
{.compile}
instead of using a dll, but I think it all works the same, and it seems to fail the same both ways.