| Summary: | SDL_PushAudio | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Paul Cercueil <paul> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | 2.0.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | Patch that implements SDL_PushAudio | ||
We ended up adding an SDL_QueueAudio() API, for 2.0.4, that does something like this.
https://hg.libsdl.org/SDL/file/4528766f5d2c/include/SDL_audio.h#l482
--ryan.
|
Created attachment 869 [details] Patch that implements SDL_PushAudio I'm the co-author of a Linux distribution targetted at open-source handheld consoles, that embeds SDL, and supports a couple of SDL emulators like gnuboy or snes9x. Emulators are really the special case where SDL becomes unadapted when it comes to submitting sound, as they generally want to "push" sound and doesn't map well to the "pull" interface used by SDL. So instead of patching every emulator I work on to cope with the callback, I added a push interface to SDL. See the attached patch. As ALSA and OSS (and probably others) do already provide a push interface, the current implementation could be enhanced; SDL_PushAudio could write directly to the buffer of the audio device (provided no conversion is necessary). Best regards, Paul Cercueil