Default sample type in SunVox lib

Multi-platform modular music creation studio
Post Reply
Penguinum-tea
Posts: 5
Joined: Mon Jan 04, 2021 7:40 pm

Default sample type in SunVox lib

Post by Penguinum-tea »

Hello.
There are 2 flags that you can use in sv_init to set sample type used by SunVox lib: SV_INIT_FLAG_AUDIO_INT16 and SV_INIT_FLAG_AUDIO_FLOAT32. But what's default? I mean, what sample type is used if you pass 0 as flags variable? Sorry if it's in docs, couldn't find.
Penguinum-tea
Posts: 5
Joined: Mon Jan 04, 2021 7:40 pm

Re: Default sample type in SunVox lib

Post by Penguinum-tea »

OK, from experiment it seems that default is int16_t. But is it really default or the library somehow decides which type to use?
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Default sample type in SunVox lib

Post by NightRadio »

Hi!

If SV_INIT_FLAG_OFFLINE is set: the default is INT16.

If SV_INIT_FLAG_OFFLINE is not set: the default value is system-dependent; and the actual sample type may be different even if you specify it with SV_INIT_FLAG_USER_AUDIO_INT16/FLOAT32
Penguinum-tea
Posts: 5
Joined: Mon Jan 04, 2021 7:40 pm

Re: Default sample type in SunVox lib

Post by Penguinum-tea »

Thank you for the reply, was helpful!
A little bit off-topic question: can parts of SunVox lib documentation (explaining flags) be included in source of MIT-licensed binding of SunVox lib as comments? May seem a strange question, but stuff like that needs to be explicitly permitted (or not), I guess.
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Default sample type in SunVox lib

Post by NightRadio »

can parts of SunVox lib documentation (explaining flags) be included in source of MIT-licensed binding of SunVox lib as comments?
Of course
Post Reply