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 » Mon Jan 04, 2021 7:58 pm

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 » Mon Jan 04, 2021 8:12 pm

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: 3469
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Default sample type in SunVox lib

Post by NightRadio » Tue Jan 05, 2021 3:20 pm

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 » Sat Jan 09, 2021 12:06 am

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: 3469
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Default sample type in SunVox lib

Post by NightRadio » Sat Jan 09, 2021 4:12 pm

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