in_channels - number of input channels.in_type - input buffer type: 0 - int16_t (16bit integer) 1 - float (32bit floating point).out_time - buffer output time (in system ticks).frames - number of frames in destination buffer.buf - output buffer of type int16_t (if SV_INIT_FLAG_AUDIO_INT16 is set in sv_init()) or float (if SV_INIT_FLAG_AUDIO_FLOAT32 is set in sv_init()) stereo data will be interleaved in this buffer: LRLR. sv_audio_callback2( out_buf, frames, latency, out_time, in_type, in_channels, in_buf ).sv_audio_callback( out_buf, frames, latency, out_time ).int audio_callback2( byte buf, int frames, int latency, int out_time, int in_type, int in_channels, byte in_buf ).int audio_callback( byte buf, int frames, int latency, int out_time ).int sv_audio_callback2( void* buf, int frames, int latency, uint32_t out_time, int in_type, int in_channels, void* in_buf ).int sv_audio_callback( void* buf, int frames, int latency, uint32_t out_time ).Sv_audio_callback2() - send some data to the Input module and receive the filtered data from the Output module. Sv_audio_callback() - get the next piece of SunVox audio from the Output module. SV_INIT_FLAG_OFFLINE flag in sv_init() must be set. With these functions you can ignore the built-in SunVox sound output mechanism and render to memory / file / some other sound system. Print (f"Init Sound succeeded!") if ver>=0 else print (f"Link Sound failed, error:") Libname=os.path.join(scriptdir,"sunvox.so") Python + dynamic lib (Linux): import ctypes Then you can use this object (similar to the slot on other platforms) to load and play SunVox files. Then you can load and play some files in this slot. Int ver = SunVoxLib.init( null, 44100, 2, 0 ) SUNVOX_STATIC_LIB tells the compiler that all functions should be included at build time. Then you can load and play some files in this slot.Ĭ + static lib (iOS): #define SUNVOX_STATIC_LIB /* We are using a static lib. SUNVOX_MAIN adds implementation of sv_load_dll()/sv_unload_dll() */ #Sunvox import eav archive#Other examples (more complex projects) can be found in the archive with the library.Ĭ + dynamic lib (Windows, Linux, macOS): #define SUNVOX_MAIN /* We are using a dynamic lib. #Sunvox import eav code#Here are examples of minimal code for different platforms.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |