This magically fixes the stupid header maps that were pulling the system
semaphore.h into Swift projects, when they shouldn't have been doing
that in the first place. This is the same reason that the FLAC library
has its assert.h renamed to FLAC_assert.h.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
These imports needed to be changed so that Swift bridging didn't import
the system's semaphore.h instead of CogAudio's Semaphore.h, which is a
completely different thing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move the Float32 converter to a different location, for any future plans
to support decoding audio files to common data for any other purpose.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
readAudio now returns an AudioChunk object directly, and all inputs have
been changed to accomodate this. Also, input and converter processing
have been altered to better work with this.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
As it doesn't seem to work properly on Intel machines, anyway. It just
leads to pointless crashes, and doesn't seem to serve any purpose.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apply changes to exit the thread if workgroup initialization or joining
fails, instead of attempting to continue executing the thread.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The changes include no longer leaving the workgroup for seeking or for
converter format changes, and also still leaving the workgroup on thread
termination if there was an error with intervals starting or finishing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Set baseline real-time priority for audio threads even on old macOS,
since that API is available there. Only set it once, and do not attempt
again if it fails, only once per thread.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Now it allocates audio workgroups per thread, using work slices like the
Apple documentation describes for asynchronous threads.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
On Big Sur or newer, it is possible to join the audio threads to the
same OS workgroup as the audio output device, improving response.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Sample format can now change dynamically at play time, and the player
will resample it as necessary, extrapolating edges between changes to
reduce the potential for gaps.
Currently supported formats for this:
- FLAC
- Ogg Vorbis
- Any format supported by FFmpeg, such as MP3 or AAC
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This implements the basic output and mixing support for channel config
bits, optionally set by the input plugin.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Rewrite attempt number two. Now using array lists of audio chunks, with
each chunk having its format and optionally losslessness stashed along
with it. This replaces the old virtual ring buffer method. As a result
of this, the HRIR toggle now works instantaneously.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
After all this rewriting, down or upmixing the audio is now handled with
the lowest latency possible, meaning that toggling the HRIR option now
takes effect immediately.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>