mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
MINI_AL_IMPLEMENTATION to MINIAUDIO_IMPLEMENTATION.
This commit is contained in:
@@ -51,7 +51,7 @@ Building
|
|||||||
======
|
======
|
||||||
Do the following in one source file:
|
Do the following in one source file:
|
||||||
```
|
```
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "miniaudio.h"
|
#include "miniaudio.h"
|
||||||
```
|
```
|
||||||
Then just compile. There's no need to install any dependencies. On Windows and macOS there's no need to link
|
Then just compile. There's no need to install any dependencies. On Windows and macOS there's no need to link
|
||||||
@@ -69,7 +69,7 @@ Simple Playback Example
|
|||||||
#define DR_WAV_IMPLEMENTATION
|
#define DR_WAV_IMPLEMENTATION
|
||||||
#include "../extras/dr_wav.h" // Enables WAV decoding.
|
#include "../extras/dr_wav.h" // Enables WAV decoding.
|
||||||
|
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -154,7 +154,7 @@ relevant backend library before the implementation of miniaudio, like so:
|
|||||||
#include "dr_mp3.h" // Enables MP3 decoding.
|
#include "dr_mp3.h" // Enables MP3 decoding.
|
||||||
#include "dr_wav.h" // Enables WAV decoding.
|
#include "dr_wav.h" // Enables WAV decoding.
|
||||||
|
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "miniaudio.h"
|
#include "miniaudio.h"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This example simply captures data from your default microphone until you press Enter. The output is saved to the file specified on the command line.
|
// This example simply captures data from your default microphone until you press Enter. The output is saved to the file specified on the command line.
|
||||||
|
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#define DR_WAV_IMPLEMENTATION
|
#define DR_WAV_IMPLEMENTATION
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#define DR_WAV_IMPLEMENTATION
|
#define DR_WAV_IMPLEMENTATION
|
||||||
#include "../extras/dr_wav.h" // Enables WAV decoding.
|
#include "../extras/dr_wav.h" // Enables WAV decoding.
|
||||||
|
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
+3
-3
@@ -154,7 +154,7 @@ Supported Formats:
|
|||||||
USAGE
|
USAGE
|
||||||
=====
|
=====
|
||||||
miniaudio is a single-file library. To use it, do something like the following in one .c file.
|
miniaudio is a single-file library. To use it, do something like the following in one .c file.
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "miniaudio.h"
|
#include "miniaudio.h"
|
||||||
|
|
||||||
You can then #include this file in other parts of the program as you would with any other header file.
|
You can then #include this file in other parts of the program as you would with any other header file.
|
||||||
@@ -2951,7 +2951,7 @@ mal_uint64 mal_sine_wave_read_f32_ex(mal_sine_wave* pSineWave, mal_uint64 frameC
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#if defined(MINI_AL_IMPLEMENTATION) || defined(MAL_IMPLEMENTATION)
|
#if defined(MINIAUDIO_IMPLEMENTATION)
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h> // For INT_MAX
|
#include <limits.h> // For INT_MAX
|
||||||
#include <math.h> // sin(), etc.
|
#include <math.h> // sin(), etc.
|
||||||
@@ -31305,7 +31305,7 @@ mal_uint64 mal_sine_wave_read_f32_ex(mal_sine_wave* pSineWave, mal_uint64 frameC
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MINI_AL_IMPLEMENTATION */
|
#endif /* MINIAUDIO_IMPLEMENTATION */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
BACKEND IMPLEMENTATION GUIDLINES
|
BACKEND IMPLEMENTATION GUIDLINES
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ window are not included in the calculation.
|
|||||||
mal_uint64 mal_resampler_get_expected_output_frame_count(mal_resampler* pResampler, mal_uint64 inputFrameCount);
|
mal_uint64 mal_resampler_get_expected_output_frame_count(mal_resampler* pResampler, mal_uint64 inputFrameCount);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MINI_AL_IMPLEMENTATION
|
#ifdef MINIAUDIO_IMPLEMENTATION
|
||||||
|
|
||||||
#ifndef MAL_RESAMPLER_MIN_RATIO
|
#ifndef MAL_RESAMPLER_MIN_RATIO
|
||||||
#define MAL_RESAMPLER_MIN_RATIO 0.02083333
|
#define MAL_RESAMPLER_MIN_RATIO 0.02083333
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ void* mal_pcm_rb_get_subbuffer_ptr(mal_pcm_rb* pRB, size_t subbufferIndex, void*
|
|||||||
|
|
||||||
#endif // mal_ring_buffer_h
|
#endif // mal_ring_buffer_h
|
||||||
|
|
||||||
#ifdef MINI_AL_IMPLEMENTATION
|
#ifdef MINIAUDIO_IMPLEMENTATION
|
||||||
MAL_INLINE mal_uint32 mal_rb__extract_offset_in_bytes(mal_uint32 encodedOffset)
|
MAL_INLINE mal_uint32 mal_rb__extract_offset_in_bytes(mal_uint32 encodedOffset)
|
||||||
{
|
{
|
||||||
return encodedOffset & 0x7FFFFFFF;
|
return encodedOffset & 0x7FFFFFFF;
|
||||||
@@ -634,4 +634,4 @@ void* mal_pcm_rb_get_subbuffer_ptr(mal_pcm_rb* pRB, size_t subbufferIndex, void*
|
|||||||
return mal_rb_get_subbuffer_ptr(&pRB->rb, subbufferIndex, pBuffer);
|
return mal_rb_get_subbuffer_ptr(&pRB->rb, subbufferIndex, pBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MINI_AL_IMPLEMENTATION
|
#endif // MINIAUDIO_IMPLEMENTATION
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "../../../../dr_libs/dr_wav.h"
|
#include "../../../../dr_libs/dr_wav.h"
|
||||||
|
|
||||||
#define MAL_DEBUG_OUTPUT
|
#define MAL_DEBUG_OUTPUT
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../../miniaudio.h"
|
#include "../../miniaudio.h"
|
||||||
#include "../mal_resampler.h"
|
#include "../mal_resampler.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
#define MAL_LOG_LEVEL MAL_LOG_LEVEL_VERBOSE
|
#define MAL_LOG_LEVEL MAL_LOG_LEVEL_VERBOSE
|
||||||
#define MAL_DEBUG_OUTPUT
|
#define MAL_DEBUG_OUTPUT
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
int print_context_info(mal_context* pContext)
|
int print_context_info(mal_context* pContext)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define MAL_DEBUG_OUTPUT
|
#define MAL_DEBUG_OUTPUT
|
||||||
#define MAL_USE_REFERENCE_CONVERSION_APIS
|
#define MAL_USE_REFERENCE_CONVERSION_APIS
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
// Two converters are needed here. One for converting f32 samples from the sine wave generator to the input format,
|
// Two converters are needed here. One for converting f32 samples from the sine wave generator to the input format,
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define MAL_DEBUG_OUTPUT
|
#define MAL_DEBUG_OUTPUT
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#define DR_WAV_IMPLEMENTATION
|
#define DR_WAV_IMPLEMENTATION
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../extras/dr_wav.h"
|
#include "../extras/dr_wav.h"
|
||||||
|
|
||||||
#define MAL_NO_DEVICE_IO
|
#define MAL_NO_DEVICE_IO
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#define MAL_NO_AVX2
|
#define MAL_NO_AVX2
|
||||||
|
|
||||||
#ifdef NO_SIGVIS
|
#ifdef NO_SIGVIS
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
#else
|
#else
|
||||||
#define MINI_SIGVIS_IMPLEMENTATION
|
#define MINI_SIGVIS_IMPLEMENTATION
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
mal_sine_wave sineWave;
|
mal_sine_wave sineWave;
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define MAL_DEBUG_OUTPUT
|
//#define MAL_DEBUG_OUTPUT
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../miniaudio.h"
|
#include "../miniaudio.h"
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ float msigvis_channel_get_sample_f32(msigvis_channel* pChannel, mal_uint32 iSamp
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#ifdef MINI_SIGVIS_IMPLEMENTATION
|
#ifdef MINI_SIGVIS_IMPLEMENTATION
|
||||||
#define MINI_AL_IMPLEMENTATION
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
#include "../../miniaudio.h"
|
#include "../../miniaudio.h"
|
||||||
#include "../external/dred/source/dred/dtk/dtk.c"
|
#include "../external/dred/source/dred/dtk/dtk.c"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user