Fix some warnings with some more examples.

This commit is contained in:
David Reid
2025-02-17 16:52:54 +10:00
parent de5f370d09
commit 01d6297bec
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -13,7 +13,7 @@ head.
#include "../miniaudio.h"
#define SDL_MAIN_HANDLED
#include <SDL.h> /* Change this to your include location. Might be <SDL2/SDL.h>. */
#include <SDL2/SDL.h> /* Change this to your include location. Might be <SDL.h>. */
#define CHANNELS 2 /* Must be stereo for this example. */
#define SAMPLE_RATE 48000
@@ -23,6 +23,8 @@ static ma_sound g_sound; /* This example will play only a single soun
void data_callback(void* pUserData, ma_uint8* pBuffer, int bufferSizeInBytes)
{
(void)pUserData;
/* 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));
ma_engine_read_pcm_frames(&g_engine, pBuffer, bufferSizeInFrames, NULL);