-
In documentation, in the Datasources section we can find the following:
The question is: What exactly is inefficient? Is it using Also does it make sense to do: ma_data_source ds = ma_sound_get_data_source(pOrig_sound);
ma_sound_init_from_data_source(&g_engine, ds, 0, NULL, new_sound); And use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The documentation is saying that the seeking is the inefficient part. Each decoding backend is different. MP3, for example, does not have a built-in mechanism for accelerated seeking which means it needs to brute force it by seeking to the start of the sound and the reading and discarding every sample until the seek target which is extremely inefficient. It does not make any sense to use the code you suggested. You need to get the idea of reusing data sources out of your head. It's not a thing in miniaudio. It's one data source instance to one sound instance in all cases, no exceptions. |
Beta Was this translation helpful? Give feedback.
The documentation is saying that the seeking is the inefficient part. Each decoding backend is different. MP3, for example, does not have a built-in mechanism for accelerated seeking which means it needs to brute force it by seeking to the start of the sound and the reading and discarding every sample until the seek target which is extremely inefficient.
It does not make any sense to use the code you suggested. You need to get the idea of reusing data sources out of your head. It's not a thing in miniaudio. It's one data source instance to one sound instance in all cases, no exceptions.