SunVox DLL: cannot lock/unlock to load a module [FIXED 23.10.16]

Found a bug? Post it here.
Post Reply
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

SunVox DLL: cannot lock/unlock to load a module [FIXED 23.10.16]

Post by queries »

I'm running into trouble loading a module from disk while using user-audio-callback and one-thread flags.

It won't let me use lock/unlock even though I am definitely calling them.

I've been able to replicate it with the test code.

Here's the output I get:

Code: Select all

Language: en_US
SunVox lib version: 1.9.1
Loading SunVox song from file...
< ... >
Loaded.
sv_connect_module error: use it within sv_lock_slot() / sv_unlock_slot() block only!
SOUND: sound_stream_deinit() begin
SOUND: sound_stream_deinit() end
Max memory used: 1952718
Here's the diff:

Code: Select all

diff --git a/osx/sample_project/test5.cpp b/osx/sample_project/test5.cpp
index 2155a75..d7a7df1 100644
--- a/osx/sample_project/test5.cpp
+++ b/osx/sample_project/test5.cpp
@@ -52,6 +52,11 @@ int main()
            printf( "Load error.\n" );
        sv_volume( 0, 256 );

+       sv_lock_slot( 0 );
+       int module = sv_load_module( 0, "organ.sunsynth", 512, 512, 512 );
+       sv_connect_module( 0, module, 0 );
+       sv_unlock_slot( 0 );
+
        sv_play_from_beginning( 0 );

        //Saving the audio stream to the file:
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: SunVox DLL: cannot lock/unlock to load a module

Post by NightRadio »

I believe it is fixed now :) Please download the latest version (based on SunVox 1.9.2 BETA2): http://warmplace.ru/soft/sunvox/sunvox_dll.zip
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: SunVox DLL: cannot lock/unlock to load a module

Post by queries »

Fantastic! I'll be sure to test it soon.
Post Reply