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 1481

Summary: Sound_GetDuration() backport to stable-1.0
Product: SDL_sound Reporter: Nikos Chantziaras <realnc>
Component: everythingAssignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Ryan C. Gordon <icculus>
Severity: enhancement    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: Backport of Sound_DecodeAll() from development branch

Description Nikos Chantziaras 2012-04-22 16:47:38 UTC
Created attachment 848 [details]
Backport of Sound_DecodeAll() from development branch

I was previously using SDL_sound for audio decoding in my apps and simply used Sound_DecodeAll() for the job.  That meant I could calculate the duration easily.  This was a horrible memory waster though (playing a few layered tracks simultaneously would eat up anywhere between 100 and 300MB RAM.)

So I switched to Sound_Decode().  However, being able to tell the duration of the sample is critical.  Since SDL_sound might need some time for a proper release, I ported Sound_DecodeAll() from the development branch to the stable-1.0 branch.  It's a backport of these:

  http://hg.icculus.org/icculus/SDL_sound/rev/c66080364dff
  http://hg.icculus.org/icculus/SDL_sound/rev/3e705c9180e5

Note that binary compatibility with SDL_sound 1.0 is preserved.