Why doesn't sdl_mixer support multiple music streams?

My (possibly flawed) understanding is that the main difference between music and sounds (represented by Mix_Chunks) is that music is streamed rather than loaded into a buffer, but I’m not sure why that would require that only one stream be played at a time. Wanting to play more than one music track at a time is a pretty standard thing to want to do, so it’s annoying that I don’t have that option.

Amablue wrote:

My (possibly flawed) understanding is that the main difference between music and sounds (represented by Mix_Chunks) is that music is streamed rather than loaded into a buffer, but I’m not sure why that would require that only one stream be played at a time. Wanting to play more than one music track at a time is a pretty standard thing to want to do, so it’s annoying that I don’t have that option.

Read ogg as sound and play it but is too much memory. I see no problems

I think in most case people would play only one music stream at a time. That’s why it’s designed with only one possible stream being played.

There are some cases that I would love to have sounds played as streams (eg. voice for a long dialogue), but play it as a chunk might not be so bad.

It has been on the todo list for a long time, I believe. There might even
be some patches floating around in the mailing list or bugzilla. It breaks
the API a bit (e.g. Mix_PauseMusic etc.), so that might be why it hasn’t
been put in yet.

Jonny DOn Wed, Sep 17, 2014 at 11:01 AM, mr_tawan <mr_tawan at hotmail.com> wrote:

I think in most case people would play only one music stream at a time.
That’s why it’s designed with only one possible stream being played.

There are some cases that I would love to have sounds played as streams
(eg. voice for a long dialogue), but play it as a chunk might not be so bad.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

When playing long songs (or on platforms where memory is tight) it can be preferable to stream music. I know that I can do that, but I’m curious as to why it’s required. I’d be happy to code in support for multiple streams myself if that’s what it takes, but I’m curious why the design decision was made in the first place. Was it an oversight? Is there some non-obvious reason it wasn’t implemented?

Probably because it was easier not to. SDL_Mixer was a quick and dirty
library rather than a comprehensive solution.

Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768On Wed, Sep 17, 2014 at 6:13 AM, Amablue <alexander.ames at gmail.com> wrote:

When playing long songs (or on platforms where memory is tight) it can
be preferable to stream music. I know that I can do that, but I’m curious
as to why it’s required. I’d be happy to code in support for multiple
streams myself if that’s what it takes, but I’m curious why the design
decision was made in the first place. Was it an oversight? Is there some
non-obvious reason it wasn’t implemented?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I already added that support (it was complete and finished), but it was
not included upstream in-time. I was later asked to rebase it for
inclusion, but I don’t have the time for that.

If you’re interested in rebasing it for current versions of SDL_mixer,
here it is:

https://bitbucket.org/realnc/sdl_mixer

It’s basically SDL_mixer 1.2.13 from 2012-08-19.On 17/09/14 03:43, Amablue wrote:

When playing long songs (or on platforms where memory is tight) it can
be preferable to stream music. I know that I can do that, but I’m
curious as to why it’s required. I’d be happy to code in support for
multiple streams myself if that’s what it takes, but I’m curious why the
design decision was made in the first place. Was it an oversight? Is
there some non-obvious reason it wasn’t implemented?

    streams?

Message-ID: <1410914622.m2f.45328 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

When playing long songs (or on platforms where memory is tight) it can be preferable to
stream music. I know that I can do that, but I’m curious as to why it’s required. I’d be happy
to code in support for multiple streams myself if that’s what it takes, but I’m curious why the
design decision was made in the first place. Was it an oversight? Is there some non-obvious
reason it wasn’t implemented?

I believe that it was mentioned on the mailinglist within the last
three months as being an oversight. That having been said, if you
actually want to do the support then:

  1. Double check the mailinglist archives to verify my memory, and
  2. Coordinate with Sam and Ryan, as I believe that one of them
    mentioned it as being a planned change: there might be some other
    things to go in at the same time, so it’s best to avoid accidentally
    stepping on toes.> Date: Wed, 17 Sep 2014 00:43:42 +0000

From: “Amablue” <alexander.ames at gmail.com>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Why doesn’t sdl_mixer support multiple music

Nikos Chantziaras wrote:

I already added that support (it was complete and finished), but it was
not included upstream in-time. I was later asked to rebase it for
inclusion, but I don’t have the time for that.

Thanks for sharing that link. I’m getting ready to start using this in my project.

If I wanted to get these changes merged into sdl_mixer, what’s the right way to do that? I notice there’s a bug about the issue here (“https://bugzilla.libsdl.org/show_bug.cgi?id=1194”), do I just attach the patch and leave a comment? Should I shoot an email to Sam or Ryan?

Hi,

you can take a look into my repo here:


src/afdaddc5f211bf252101b67466fb271bb721c68d/dependencies/SDL_mixer/jni/?at=
default

I have merged the patch into a recent SDL mixer. (Plus some additional stuff
which you probably do not need) Might avoid double effort.

Regards,

Daniel

---------- P?vodn? zpr?va ----------
Od: Amablue <alexander.ames at gmail.com>
Komu: sdl at lists.libsdl.org
Datum: 20. 2. 2015 0:10:01
P?edm?t: Re: [SDL] Why doesn’t sdl_mixer support multiple music streams?

"

                     Nikos Chantziaras wrote:	 

I already added that support (it was complete and finished), but it was
not included upstream in-time. I was later asked to rebase it for
inclusion, but I don’t have the time for that.

Thanks for sharing that link. I’m getting ready to start using this in my
project.

If I wanted to get these changes merged into sdl_mixer, what’s the right way
to do that? I notice there’s a bug about the issue here, do I just attach the patch and
leave a comment? Should I shoot an email to Sam or Ryan?_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org"