We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 821

Summary: Redesign audio conversion API...
Product: SDL Reporter: Ryan C. Gordon <icculus>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: API change    
Priority: P3    
Version: HG 2.1   
Hardware: All   
OS: All   

Description Ryan C. Gordon 2009-10-02 22:53:38 UTC
Just a braindump from an IM conversation with Sam, for changing the audio conversion API for 1.3. 

Ryan C. Gordon
Jabber
12:27
as for conversion code:
12:27
Ideally, it looks something like:
12:28
int SDL_ConvertBufferSize(SDL_AudioCVT *cvt, int input_buffer_size);
12:28
 returns number of bytes you need to convert input_buffer_size bytes to cvt format.
12:28
and then a static buffer converter.
Sam Lantinga
GTalk
12:28
Hmm, I like that.
Ryan C. Gordon
Jabber
12:28
But also something like what zlib does:
12:29
you feed it data, and say "i want X bytes now" and it gives you more, or tells you to feed it more.
12:29
It's a little more high level, but it's pleasant for streaming.
Sam Lantinga
GTalk
12:29
We'd probably want size functions both ways
12:29
SDL_ConvertBufferInputSize(), and SDL_ConvertBufferOutputSize()
Ryan C. Gordon
Jabber
12:29
The second approach requires SDL to buffer some data between calls.
Sam Lantinga
GTalk
12:30
Well, the AudioCVT structure could be changed to stream
12:30
maybe
Ryan C. Gordon
Jabber
12:30
But honestly, when you have to do this with zlib, it's actually really nice for the caller.
Sam Lantinga
GTalk
12:30
Yeah
12:30
That sounds awesome!
Comment 1 Ryan C. Gordon 2009-12-15 22:39:28 UTC
Priority change.

--ryan.
Comment 2 Ryan C. Gordon 2017-05-18 19:21:41 UTC
There aren't plans to do this right away, but the new SDL_AudioStream stuff could be turned into a public API easily enough at some point.
Comment 3 Ryan C. Gordon 2018-02-17 23:14:47 UTC
The streaming API landed in 2.0.7, so...resolved!

--ryan.