Comments (2)
Is it possible to configure SDL3 to invoke the audio callback such that it always asks for the same number of samples every time it is called?
No, but the callback also does not care how much data you actually put to the audiostream on each call. If you give it less than requested, it will fill the rest of the playback time with silence (which could make sense at the end of playback), and if you give it more, it'll just have extra already available when it goes to consume more data.
Which is to say: you can just feed the thing a fixed amount every time it runs, regardless of what it asks for.
The only gotcha is that you need to make sure you give it at least what it asks for so you don't get skips in the audio. After opening the audio device, you can call SDL_GetAudioDeviceFormat to find out how much data it intends to consume at a time, and then set up the middleware to output that much audio per iteration.
from sdl.
This works, thanks!
from sdl.
Related Issues (20)
- Media Foundation camera implementation isn't built by CMake HOT 3
- Typo in SDL_filesystem.h docs HOT 4
- Vulkan renderer always uses vsync
- [X11, SDL2] SDL_SetWindowMinimumSize causes the window to be raised
- Landscape fullscreen apps have black bars on both sides of the screen on iPad Air 5th gen.
- Memory usage has increased by a massive amount recently HOT 1
- Build SDL release artifacts in GitHub Actions CI
- 2.30.0 release SDL2.dll causes an exception inside SDL_ConvertAudio
- Review the hints API HOT 1
- [Vulkan Renderer] Incorrect memory type selected HOT 2
- Segfault in 2D Vulkan renderer HOT 2
- [sdl3, X11] CMake does not detect X11 anymore HOT 5
- SDL3 macOS build no longer a universal library HOT 11
- Direct2D12 no longer works with ImGui's SDL3+SDL_Renderer correctly HOT 7
- SDL3 Request: Date and Time API HOT 2
- `JoyDeviceEvent`'s `SDL_EVENT_JOYSTICK_ADDED` `which` field does not refer to a `SDL_JoystickID` HOT 9
- No `arm-linux-gnueabihf-gcc` cmake toolchain HOT 1
- Clip rect automated test fails with the Vulkan renderer
- UWP SDL3: SDL_GetWindowSizeInPixels returns points not pixels
- SDL3, Steam Deck is reported as Steam Virtual Gamepad HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl.