Since the calling thread is waiting anyway, it's better to just do the
processing on the calling thread rather than posting it to the job
queue and waiting. This ensures the calling thread stays busy which
will improve performance, but it also makes it so the calling thread
doesn't get stalled while already-queued jobs are getting processed.
This is still not working on my machine. The device will initialize and
run, but the captured data is always silent for some reason. I have
been unable to figure out how to make this work.
This commit allows initialization of the device to complete at the very
least.
Public issue https://github.com/mackron/miniaudio/issues/484
The issue here is that it's possible for miniaudio to attempt to access
data from a WAVEFORMATEXTENSIBLE structure when the object is actually
only a WAVEFORMATEX structure which is smaller which can therefore
result in trying to access unallocated memory.
Public issue https://github.com/mackron/miniaudio/issues/660
Smoothing is disabled by default. To enable it, you must use
ma_sound_init_ex() and configure it via the volumeSmoothTimeInPCMFrames
member of ma_sound_config.
This commit also fixes a bug where ma_gainer is not properly applying
smoothing.
This example captures data from the microphone using the low-level API
and then plays back the data through the engine. The intermediary data
source is a ring buffer.
* ma_engine_get_time_in_pcm_frames() (replaces ma_engine_get_time())
* ma_engine_get_time_in_milliseconds()
* ma_engine_set_time_in_pcm_frames() (replaces ma_engine_set_time())
* ma_engine_set_time_in_milliseconds()
These changes are consistent with the naming of other time based
functions, eliminates ambiguity and just makes it clearer as to what
you're working with.
ma_engine_get_time() and ma_engine_set_time() have been deprecated.
This is not pre-initializing the variable that receives the number of
bytes read to 0 which can result in custom VFS implementations
returning an invalid value if they return early from an error or
whatnot.