Put this one back, that one didn't need to change :)
@@ -72,14 +72,14 @@ sound_t sound_generate(float (*function)(float), float duration) {
sound_t result = (_sound_t*)assets_allocate(asset_type_sound);
au_decoder_config = ma_decoder_config_init(SAMPLE_FORMAT, CHANNEL_COUNT, SAMPLE_RATE);
- result->sound_data = sk_malloc_t<float>((size_t)duration * (size_t)SAMPLE_RATE);
+ result->sound_data = sk_malloc_t<float>(duration * SAMPLE_RATE);
float *data = (float*)result->sound_data;
for (uint32_t i = 0, s = (size_t)(duration * SAMPLE_RATE); i < s; i += 1) {
data[i] = function((float)i / (float)SAMPLE_RATE);
}
au_decoder_config = ma_decoder_config_init(SAMPLE_FORMAT, CHANNEL_COUNT, SAMPLE_RATE);
- if (ma_decoder_init_memory_raw(result->sound_data, sizeof(float) * (size_t)(duration * SAMPLE_RATE), &au_decoder_config, &au_decoder_config, &result->decoder) != MA_SUCCESS) {
+ if (ma_decoder_init_memory_raw(result->sound_data, sizeof(float) * (duration * SAMPLE_RATE), &au_decoder_config, &au_decoder_config, &result->decoder) != MA_SUCCESS) {
log_err("Failed to generate sound!");
free(result->sound_data);
return nullptr;
