Commit 5c099791 authored by David Reid's avatar David Reid

Clean up decoding documentation.

miniaudio is updating it's amalgamation of dr_wav, etc. so that it's
all namespaced with "ma" which will make the amalgamated versions of
dr_libs entirely independent. There's no longer any need to mention
the decoding backends.

Documentation regarding stb_vorbis is removed so as to discourage
new users from using it. Support will not be removed until a
replacement Vorbis decoder can be amalgamated, but new users should
instead be guided to the libvorbis custom decoder in the extras folder.
parent 773d97a9
...@@ -2460,37 +2460,18 @@ used. The same general process applies to detachment. See `ma_node_attach_output ...@@ -2460,37 +2460,18 @@ used. The same general process applies to detachment. See `ma_node_attach_output
8. Decoding 8. Decoding
=========== ===========
The `ma_decoder` API is used for reading audio files. Decoders are completely decoupled from The `ma_decoder` API is used for reading audio files. Decoders are completely decoupled from
devices and can be used independently. The following formats are supported: devices and can be used independently. Built-in support is included for the following formats:
+---------+------------------+----------+ +---------+
| Format | Decoding Backend | Built-In | | Format |
+---------+------------------+----------+ +---------+
| WAV | dr_wav | Yes | | WAV |
| MP3 | dr_mp3 | Yes | | MP3 |
| FLAC | dr_flac | Yes | | FLAC |
| Vorbis | stb_vorbis | No | +---------+
+---------+------------------+----------+
Vorbis is supported via stb_vorbis which can be enabled by including the header section before the You can disable the built-in decoders by specifying one or more of the following options before the
implementation of miniaudio, like the following: miniaudio implementation:
```c
#define STB_VORBIS_HEADER_ONLY
#include "extras/stb_vorbis.c" // Enables Vorbis decoding.
#define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h"
// The stb_vorbis implementation must come after the implementation of miniaudio.
#undef STB_VORBIS_HEADER_ONLY
#include "extras/stb_vorbis.c"
```
A copy of stb_vorbis is included in the "extras" folder in the miniaudio repository (https://github.com/mackron/miniaudio).
Built-in decoders are amalgamated into the implementation section of miniaudio. You can disable the
built-in decoders by specifying one or more of the following options before the miniaudio
implementation:
```c ```c
#define MA_NO_WAV #define MA_NO_WAV
...@@ -2498,8 +2479,8 @@ implementation: ...@@ -2498,8 +2479,8 @@ implementation:
#define MA_NO_FLAC #define MA_NO_FLAC
``` ```
Disabling built-in decoding libraries is useful if you use these libraries independently of the miniaudio supports the ability to plug in custom decoders. See the section below for details on how
`ma_decoder` API. to use custom decoders.
A decoder can be initialized from a file with `ma_decoder_init_file()`, a block of memory with A decoder can be initialized from a file with `ma_decoder_init_file()`, a block of memory with
`ma_decoder_init_memory()`, or from data delivered via callbacks with `ma_decoder_init()`. Here is `ma_decoder_init_memory()`, or from data delivered via callbacks with `ma_decoder_init()`. Here is
...@@ -2640,8 +2621,7 @@ opportunity to clean up and internal data. ...@@ -2640,8 +2621,7 @@ opportunity to clean up and internal data.
9. Encoding 9. Encoding
=========== ===========
The `ma_encoding` API is used for writing audio files. The only supported output format is WAV The `ma_encoding` API is used for writing audio files. The only supported output format is WAV.
which is achieved via dr_wav which is amalgamated into the implementation section of miniaudio.
This can be disabled by specifying the following option before the implementation of miniaudio: This can be disabled by specifying the following option before the implementation of miniaudio:
```c ```c
...@@ -10056,7 +10036,7 @@ struct ma_encoder ...@@ -10056,7 +10036,7 @@ struct ma_encoder
ma_encoder_uninit_proc onUninit; ma_encoder_uninit_proc onUninit;
ma_encoder_write_pcm_frames_proc onWritePCMFrames; ma_encoder_write_pcm_frames_proc onWritePCMFrames;
void* pUserData; void* pUserData;
void* pInternalEncoder; /* <-- The drwav/drflac/stb_vorbis/etc. objects. */ void* pInternalEncoder;
union union
{ {
struct struct
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment