mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 08:14:04 +02:00
Merge branch 'dev' into dev-0.12
This commit is contained in:
@@ -22,10 +22,12 @@ static ma_sound g_sound; /* This example will play only a single soun
|
|||||||
|
|
||||||
void data_callback(void* pUserData, ma_uint8* pBuffer, int bufferSizeInBytes)
|
void data_callback(void* pUserData, ma_uint8* pBuffer, int bufferSizeInBytes)
|
||||||
{
|
{
|
||||||
|
ma_uint32 bufferSizeInFrames;
|
||||||
|
|
||||||
(void)pUserData;
|
(void)pUserData;
|
||||||
|
|
||||||
/* Reading is just a matter of reading straight from the engine. */
|
/* Reading is just a matter of reading straight from the engine. */
|
||||||
ma_uint32 bufferSizeInFrames = (ma_uint32)bufferSizeInBytes / ma_get_bytes_per_frame(ma_format_f32, ma_engine_get_channels(&g_engine));
|
bufferSizeInFrames = (ma_uint32)bufferSizeInBytes / ma_get_bytes_per_frame(ma_format_f32, ma_engine_get_channels(&g_engine));
|
||||||
ma_engine_read_pcm_frames(&g_engine, pBuffer, bufferSizeInFrames, NULL);
|
ma_engine_read_pcm_frames(&g_engine, pBuffer, bufferSizeInFrames, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,17 @@ of buffering solution to your node.
|
|||||||
#include "../miniaudio.c"
|
#include "../miniaudio.c"
|
||||||
|
|
||||||
#include <stdint.h> /* Required for uint32_t which is used by STEAMAUDIO_VERSION, and a random use of uint8_t. If there's a Steam Audio maintainer reading this, that needs to be fixed to use IPLuint32 and IPLuint8. */
|
#include <stdint.h> /* Required for uint32_t which is used by STEAMAUDIO_VERSION, and a random use of uint8_t. If there's a Steam Audio maintainer reading this, that needs to be fixed to use IPLuint32 and IPLuint8. */
|
||||||
|
|
||||||
|
/* Need to silence some warnings from the Steam Audio headers. */
|
||||||
|
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||||
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
#endif
|
||||||
#include <phonon.h> /* Steam Audio */
|
#include <phonon.h> /* Steam Audio */
|
||||||
|
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FORMAT ma_format_f32 /* Must be floating point. */
|
#define FORMAT ma_format_f32 /* Must be floating point. */
|
||||||
#define CHANNELS 2 /* Must be stereo for this example. */
|
#define CHANNELS 2 /* Must be stereo for this example. */
|
||||||
|
|||||||
Reference in New Issue
Block a user