- 14 Jun, 2020 12 commits
-
-
David Reid authored
-
David Reid authored
This addresses some 64-bit issues with stdio with older versions of VC.
-
David Reid authored
This needs to be #define-d before the header *and* implementation because it affects the size of publicly visible structures.
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
A streaming data source keeps in memory only two pages of audio data and dynamically loads data from a background thread. It is essentially a double buffering system - as one page is playing, the other is being loaded by the async thread. The size of a single page is defined by the following macro: MA_RESOURCE_MANAGER_PAGE_SIZE_IN_MILLISECONDS By default this is currently set to 1 second of audio data. This means each page has 1 second to load which should be plenty of time. If you need additional time, the only way to do it is increase the size of the page by changing the value of the above macro. -
David Reid authored
-
- 13 Jun, 2020 6 commits
-
-
David Reid authored
* ma_resource_manager_uninit() has been implemented. * Bug fixes and inserting and removing data buffers from the BST. * Some old experimental code has been removed. * Minor whitespace clean up.
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
- 12 Jun, 2020 2 commits
-
-
David Reid authored
This enables early playback of the sound while the remainder of the sound is loaded in the background. When the first page is loaded, the sound can start playback. While it's playing, the rest of the sound is loaded in a background thread. In addition, sounds no longer need to wait for every sound prior to it in the queue to fully decode before it is able to start - it only needs to wait for the first page of each of the queued sounds to decode. This enables much fairer prioritization of asynchronously loaded sounds. This paged decoding system is *not* a true streaming solution for long sounds. Support for true streaming will be added in future commits. This commit is only concerned with filling in-memory buffers containing the whole sound in an asynchronous manner.
-
David Reid authored
-
- 11 Jun, 2020 1 commit
-
-
David Reid authored
-
- 10 Jun, 2020 2 commits
-
-
David Reid authored
* Early work on asynchronously decoding into a memory buffer. This is just an early implementation - there are still issues needing to be figured out. In particular, sounds do not automatically start until the entire file has been decoded. It would be good if they could start as soon as the first second or so of data has been decoded. -
David Reid authored
* ma_data_source_read_pcm_frames and ma_data_source_seek_pcm_frames now return a result code and output the frames read/seeked as an output parameter. * These return MA_AT_END if the end of the data source has been reached. This should never be returned if the loop parameter is set to true.
-
- 08 Jun, 2020 9 commits
-
-
David Reid authored
-
David Reid authored
This is needing to be done manually because Apple has decided to deprecate anonymous semaphores from semaphore.h which we're going to need.
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
David Reid authored
-
- 07 Jun, 2020 4 commits
-
-
David Reid authored
-
David Reid authored
* Implement the notion of a virtual file system (VFS) which is used by the resource manager for loading sound files. The idea is that the application can implement these to support loading from custom packages, archives, etc. * Add a helper API for decoding a file from a VFS and a file name. * Add some symbols representing allocation types. These are not currently used, but I've added them in preparation for changes to the allocation callbacks. The idea is that an allocation type will be passed to the callbacks to give the allocator better intel as to what it's allocating which will give it a chance to optimize. * Add some placeholders for flags for controlling how to load a data source. Currently only MA_DATA_SOURCE_FLAG_DECODE is implemented which is used to indicate to the resource manager that it should store the decoded contents of the sound file in memory rather than the raw (encoded) file data. * Support has been added to the resource manager to load audio data into memory rather than naively reading straight from disk. This eliminates file IO from the audio thread, but comes at the expense of extra memory usage. Support for streaming is not implemented as of this commit. Early (largely untested) work has been implemented to avoid loading sound files multiple times. This is a simple ref count system for now, with hashed files paths being used for the key into a binary search tree. The BST is not fully tested and likely has bugs which will be ironed out in future commits. * Support has been added for configuring the stereo pan effect. Most audio engines use a simple balancing technique to implement the pan effect, but a true pan should "move" one side to the other rather than just simply making one side quieter. With this commit, the ma_panner effect can support both modes. The default mode will be set to ma_pan_mode_balance which is just a simple balancing and is consistent with most other audio engines. A true pan can be used by setting the mode to ma_pan_mode_pan. -
David Reid authored
This was causing mmaped data sources to not loop if they coincidentally reached the end at the same time as the final output frame was written.
-
David Reid authored
-
- 06 Jun, 2020 1 commit
-
-
David Reid authored
This changes makes ma_copy_pcm_frames() a no-op when the input and output buffers are both set to the same pointer. This is useful for some in-place no-ops for effects and filters.
-
- 03 Jun, 2020 3 commits
-
-
David Reid authored
-
David Reid authored
This may be changed back to a first order LPF later on.
-
David Reid authored
-