Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory?

Short question: is an ogg-file streamed by sdl_mixer or first loaded
completely into memory?
Just want to know what happens if i allocate multiple Mix_chunks via
Mix_LoadWAV_RW from different ogg-files. Does all the files go into
memory ?
If so, i probably should better play my background music one after
another.

Code snipped:

SDL_RWops * rw=NULL; FILE *fp=NULL;
if(archive->open(fp,“data/music/dr_trance_trance_animal_II_12.ogg”))
{
rw=SDL_RWFromFP(fp, 0);
Mix_Chunk *mix=Mix_LoadWAV_RW(rw,0);
int channel = Mix_PlayChannel(-1, mix, 0); // - 1= first free
unallocated channel_________________________________________

Andre Krause
Dipl. Inf.
Department of Biological Cybernetics
Faculty of Biology
University of Bielefeld
PO Box 10 01 31
33501 Bielefeld
Germany

Phone: +49-521-106-5519
Mobil: +49-177-7465055
Home : +49-521-3044776
Email: @Andre_Krause
ICQ# : 68306404
More ways to contact me: http://wwp.icq.com/68306404
Homepage: http://www.andre-krause.net
http://www.andre-krause.de


War isn’t politics, my dear. It is indeed the only human activity that
is rottener than politics.
RexStout


I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

I was wondering the same thing. In my case, because SDL_LoadMUS_RW is not implemented (or wasn’t at 1.2.4, at least) and I want to read small .ogg files from a resource file - I have to extract the file to disk, load it, and delete it. I do load wave files from a memory RW without problems.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Andre Krause [mailto:post@andre-krause.net]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:11 p.m.
To: sdl at libsdl.org
Subject: [SDL] Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory?

Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory? Just want to know what happens if i allocate multiple Mix_chunks via Mix_LoadWAV_RW from different ogg-files. Does all the files go into memory ? If so, i probably should better play my background music one after another.

Code snipped:

SDL_RWops * rw=NULL; FILE *fp=NULL;
if(archive->open(fp,“data/music/dr_trance_trance_animal_II_12.ogg”))
{
rw=SDL_RWFromFP(fp, 0);
Mix_Chunk *mix=Mix_LoadWAV_RW(rw,0);
int channel = Mix_PlayChannel(-1, mix, 0); // - 1= first free unallocated channel


Andre Krause
Dipl. Inf.
Department of Biological Cybernetics
Faculty of Biology
University of Bielefeld
PO Box 10 01 31
33501 Bielefeld
Germany

Phone: +49-521-106-5519
Mobil: +49-177-7465055
Home : +49-521-3044776
Email: post at andre-krause.net
ICQ# : 68306404
More ways to contact me: http://wwp.icq.com/68306404
Homepage: http://www.andre-krause.net
http://www.andre-krause.de


War isn’t politics, my dear. It is indeed the only human activity that is rottener than politics. RexStout _________________________________________

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Strange - i do not need to extract my ogg-files. But my archive is not
compressed, just the files concatenated. I simply put the file-pointer
to the correct position in my archive.
I use SDL_LoadWav_RW too for ogg-files - why do you use loadmus ?

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Gabriel GambettaVon: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gesendet: Mittwoch, 14. Mai 2003 21:34
An: sdl at libsdl.org
Betreff: RE: [SDL] Short question: is an ogg-file streamed by sdl_mixer
or first loaded completely into memory?

I was wondering the same thing. In my case, because SDL_LoadMUS_RW is
not implemented (or wasn’t at 1.2.4, at least) and I want to read small
.ogg files from a resource file - I have to extract the file to disk,
load it, and delete it. I do load wave files from a memory RW without
problems.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

----- Original Message -----
From: Andre Krause [mailto:@Andre_Krause]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:11 p.m.
To: sdl at libsdl.org
Subject: [SDL] Short question: is an ogg-file streamed by sdl_mixer or
first loaded completely into memory?

Short question: is an ogg-file streamed by sdl_mixer or first loaded
completely into memory? Just want to know what happens if i allocate
multiple Mix_chunks via Mix_LoadWAV_RW from different ogg-files. Does
all the files go into memory ? If so, i probably should better play my
background music one after another.

Code snipped:

SDL_RWops * rw=NULL; FILE *fp=NULL;
if(archive->open(fp,“data/music/dr_trance_trance_animal_II_12.ogg”))
{
rw=SDL_RWFromFP(fp, 0);
Mix_Chunk *mix=Mix_LoadWAV_RW(rw,0);
int channel = Mix_PlayChannel(-1, mix, 0); // - 1= first free
unallocated channel


Andre Krause
Dipl. Inf.
Department of Biological Cybernetics
Faculty of Biology
University of Bielefeld
PO Box 10 01 31
33501 Bielefeld
Germany

Phone: +49-521-106-5519
Mobil: +49-177-7465055
Home : +49-521-3044776
Email: @Andre_Krause
ICQ# : 68306404
More ways to contact me: http://wwp.icq.com/68306404
Homepage: http://www.andre-krause.net
http://www.andre-krause.de


War isn’t politics, my dear. It is indeed the only human activity that
is rottener than politics. RexStout


I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Strange - i do not need to extract my ogg-files. But my archive is not compressed, just the files concatenated.
I simply put the file-pointer to the correct position in my archive.

I have a compressed “filesystem” in a file. That’s why I can’t read them directly. But I could not compress them… only the ogg files. Good idea!

I use SDL_LoadWav_RW too for ogg-files - why do you use loadmus ?

Because I want a Mix_Music and not a Mix_Chunk - I’m using these .oggs as music, not as sound effects. Can I just load the ogg as a chunk and play it as music? Is there any difference between playing it as music or as a sample in another channel, after all?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Andre Krause [mailto:post@andre-krause.net]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:49 p.m.
To: sdl at libsdl.org
Subject: AW: [SDL] Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory?

Strange - i do not need to extract my ogg-files. But my archive is not compressed, just the files concatenated. I simply put the file-pointer to the correct position in my archive.
I use SDL_LoadWav_RW too for ogg-files - why do you use loadmus ?

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von Gabriel Gambetta
Gesendet: Mittwoch, 14. Mai 2003 21:34
An: sdl at libsdl.org
Betreff: RE: [SDL] Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory?

I was wondering the same thing. In my case, because SDL_LoadMUS_RW is not implemented (or wasn’t at 1.2.4, at least) and I want to read small .ogg files from a resource file - I have to extract the file to disk, load it, and delete it. I do load wave files from a memory RW without problems.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Andre Krause [mailto:post@andre-krause.net]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:11 p.m.
To: sdl at libsdl.org
Subject: [SDL] Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory?

Short question: is an ogg-file streamed by sdl_mixer or first loaded completely into memory? Just want to know what happens if i allocate multiple Mix_chunks via Mix_LoadWAV_RW from different ogg-files. Does all the files go into memory ? If so, i probably should better play my background music one after another.

Code snipped:

SDL_RWops * rw=NULL; FILE *fp=NULL;
if(archive->open(fp,“data/music/dr_trance_trance_animal_II_12.ogg”))
{
rw=SDL_RWFromFP(fp, 0);
Mix_Chunk *mix=Mix_LoadWAV_RW(rw,0);
int channel = Mix_PlayChannel(-1, mix, 0); // - 1= first free unallocated channel


Andre Krause
Dipl. Inf.
Department of Biological Cybernetics
Faculty of Biology
University of Bielefeld
PO Box 10 01 31
33501 Bielefeld
Germany

Phone: +49-521-106-5519
Mobil: +49-177-7465055
Home : +49-521-3044776
Email: post at andre-krause.net
ICQ# : 68306404
More ways to contact me: http://wwp.icq.com/68306404
Homepage: http://www.andre-krause.net
http://www.andre-krause.de


War isn’t politics, my dear. It is indeed the only human activity that is rottener than politics. RexStout _________________________________________

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hmm, i dont know, but it works wonderful - the ogg file is played
without problems. So probably there is no difference at all between a
music and a wav-channel…

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Gabriel GambettaVon: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gesendet: Donnerstag, 15. Mai 2003 15:08
An: sdl at libsdl.org
Betreff: RE: [SDL] Short question: is an ogg-file streamed by sdl_mixer
or first loaded completely into memory?

Strange - i do not need to extract my ogg-files. But my archive is not

compressed, just the files concatenated. I simply put the
file-pointer to the correct position in my archive.

I have a compressed “filesystem” in a file. That’s why I can’t read them
directly. But I could not compress them… only the ogg files. Good
idea!

I use SDL_LoadWav_RW too for ogg-files - why do you use loadmus ?

Because I want a Mix_Music and not a Mix_Chunk - I’m using these .oggs
as music, not as sound effects. Can I just load the ogg as a chunk and
play it as music? Is there any difference between playing it as music or
as a sample in another channel, after all?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

----- Original Message -----
From: Andre Krause [mailto:@Andre_Krause]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:49 p.m.
To: sdl at libsdl.org
Subject: AW: [SDL] Short question: is an ogg-file streamed by sdl_mixer
or first loaded completely into memory?

Strange - i do not need to extract my ogg-files. But my archive is not
compressed, just the files concatenated. I simply put the file-pointer
to the correct position in my archive.
I use SDL_LoadWav_RW too for ogg-files - why do you use loadmus ?

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gabriel Gambetta
Gesendet: Mittwoch, 14. Mai 2003 21:34
An: sdl at libsdl.org
Betreff: RE: [SDL] Short question: is an ogg-file streamed by sdl_mixer
or first loaded completely into memory?

I was wondering the same thing. In my case, because SDL_LoadMUS_RW is
not implemented (or wasn’t at 1.2.4, at least) and I want to read small
.ogg files from a resource file - I have to extract the file to disk,
load it, and delete it. I do load wave files from a memory RW without
problems.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Andre Krause [mailto:@Andre_Krause]
Sent: Mi?rcoles, 14 de Mayo de 2003 04:11 p.m.
To: sdl at libsdl.org
Subject: [SDL] Short question: is an ogg-file streamed by sdl_mixer or
first loaded completely into memory?

Short question: is an ogg-file streamed by sdl_mixer or first loaded
completely into memory? Just want to know what happens if i allocate
multiple Mix_chunks via Mix_LoadWAV_RW from different ogg-files. Does
all the files go into memory ? If so, i probably should better play my
background music one after another.

Code snipped:

SDL_RWops * rw=NULL; FILE *fp=NULL;
if(archive->open(fp,“data/music/dr_trance_trance_animal_II_12.ogg”))
{
rw=SDL_RWFromFP(fp, 0);
Mix_Chunk *mix=Mix_LoadWAV_RW(rw,0);
int channel = Mix_PlayChannel(-1, mix, 0); // - 1= first free
unallocated channel


Andre Krause
Dipl. Inf.
Department of Biological Cybernetics
Faculty of Biology
University of Bielefeld
PO Box 10 01 31
33501 Bielefeld
Germany

Phone: +49-521-106-5519
Mobil: +49-177-7465055
Home : +49-521-3044776
Email: @Andre_Krause
ICQ# : 68306404
More ways to contact me: http://wwp.icq.com/68306404
Homepage: http://www.andre-krause.net
http://www.andre-krause.de


War isn’t politics, my dear. It is indeed the only human activity that
is rottener than politics. RexStout


I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

“Andre Krause” writes:

Hmm, i dont know, but it works wonderful - the ogg file is played
without problems. So probably there is no difference at all between a
music and a wav-channel…

Music is streaming (when possible), sfx are not. I.e load a Ogg as a
sound effect and it’s decompressed into memory at load time. If you
use good sound quality and a long song (or worse, more than one song
loaded at once) this can quickly eat up A LOT of memory.

Music on the other hand is read/decoded as needed (other than in
obvious cases when this isn’t possible, such as for mods). Currently
you have to give SDL an actual file for this, as noted.–
[ Below is a random fortune, which is unrelated to the above message. ]
When angry, count four; when very angry, swear.
– Mark Twain, “Pudd’nhead Wilson’s Calendar”

Are you really sure ? I did not notice my program eating up 20 mbytes
more mem (that would be the size of the uncompressed ogg) i think the
ogg is loaded as it is and ogg-lib can play from a memory handle.
But i will check this again and watching my memory stats while my pgro
loads !

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
David HedborVon: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gesendet: Freitag, 16. Mai 2003 00:42
An: sdl at libsdl.org
Betreff: Re: AW: [SDL] Short question: is an ogg-file streamed by
sdl_mixer or first loaded completely into memory?

“Andre Krause” <@Andre_Krause> writes:

Hmm, i dont know, but it works wonderful - the ogg file is played
without problems. So probably there is no difference at all between a
music and a wav-channel…

Music is streaming (when possible), sfx are not. I.e load a Ogg as a
sound effect and it’s decompressed into memory at load time. If you use
good sound quality and a long song (or worse, more than one song loaded
at once) this can quickly eat up A LOT of memory.

Music on the other hand is read/decoded as needed (other than in obvious
cases when this isn’t possible, such as for mods). Currently you have to
give SDL an actual file for this, as noted.


[ Below is a random fortune, which is unrelated to the above message. ]
When angry, count four; when very angry, swear.
– Mark Twain, “Pudd’nhead Wilson’s Calendar”


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Ok, i watched my memory-counter: you are right - the ogg file is first
decompressed and goes uncompressed into memory :frowning:

Hopefully sometimes RWOps functionality is implemented for ogg-file -
streaming…
Or is it principally impossible?

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Andre KrauseVon: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gesendet: Freitag, 16. Mai 2003 10:12
An: sdl at libsdl.org
Betreff: AW: AW: [SDL] Short question: is an ogg-file streamed by
sdl_mixer or first loaded completely into memory?

Are you really sure ? I did not notice my program eating up 20 mbytes
more mem (that would be the size of the uncompressed ogg) i think the
ogg is loaded as it is and ogg-lib can play from a memory handle. But i
will check this again and watching my memory stats while my pgro loads !

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
David Hedbor
Gesendet: Freitag, 16. Mai 2003 00:42
An: sdl at libsdl.org
Betreff: Re: AW: [SDL] Short question: is an ogg-file streamed by
sdl_mixer or first loaded completely into memory?

“Andre Krause” <@Andre_Krause> writes:

Hmm, i dont know, but it works wonderful - the ogg file is played
without problems. So probably there is no difference at all between a
music and a wav-channel…

Music is streaming (when possible), sfx are not. I.e load a Ogg as a
sound effect and it’s decompressed into memory at load time. If you use
good sound quality and a long song (or worse, more than one song loaded
at once) this can quickly eat up A LOT of memory.

Music on the other hand is read/decoded as needed (other than in obvious
cases when this isn’t possible, such as for mods). Currently you have to
give SDL an actual file for this, as noted.


[ Below is a random fortune, which is unrelated to the above message. ]
When angry, count four; when very angry, swear.
– Mark Twain, “Pudd’nhead Wilson’s Calendar”


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

“Andre Krause” writes:

Ok, i watched my memory-counter: you are right - the ogg file is first
decompressed and goes uncompressed into memory :frowning:

Hopefully sometimes RWOps functionality is implemented for ogg-file -
streaming…
Or is it principally impossible?

No it’s very possible, just not very viable for sound effects (imagine
10-20 concurrent effects all decoded live using mp3 or ogg - would use
way too much CPU). However you can play streamed audio using a music
track (still requires the files to be actual files though).–
[ Below is a random fortune, which is unrelated to the above message. ]
Your heart is pure, and your mind clear, and your soul devout.

No it’s very possible, just not very viable for sound effects (imagine
10-20 concurrent effects all decoded live using mp3 or ogg - would use
way too much CPU). However you can play streamed audio using a music
track (still requires the files to be actual files though).

Ok, that i do understand. But would it be possible to have a way to
handle over a file pointer instead of a filename to Mix_LoadMUS ?
Because i store my many files in an uncompressed archive, that does
nothing more than appending the files one after another. I have a
function “bool archive.open(FILE*fp, string fname)” that returns me a
filepointer that is placed at the beginning of the file in the archive.
If i could pass this pointer to playmus, i would not need to extract my
ogg - track first (what could be even impossible, if a user tries to run
the game directly from cd)

Is there a way ? I’ve not looked into the source of sdl_mixer too deeply
yet.

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
David HedborVon: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Gesendet: Freitag, 16. Mai 2003 23:37
An: sdl at libsdl.org
Betreff: Re: AW: AW: [SDL] Short question: is an ogg-file streamed by
sdl_mixer or first loaded completely into memory?

“Andre Krause” <@Andre_Krause> writes:

Ok, i watched my memory-counter: you are right - the ogg file is first

decompressed and goes uncompressed into memory :frowning:

Hopefully sometimes RWOps functionality is implemented for ogg-file -
streaming… Or is it principally impossible?

No it’s very possible, just not very viable for sound effects (imagine
10-20 concurrent effects all decoded live using mp3 or ogg - would use
way too much CPU). However you can play streamed audio using a music
track (still requires the files to be actual files though).


[ Below is a random fortune, which is unrelated to the above message. ]
Your heart is pure, and your mind clear, and your soul devout.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl