The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Resource Files using RWops
Glocke


Joined: 03 Feb 2013
Posts: 34
Hello Smile

I would like to work with own resource files using SDL v1.2 (including sdl_image and sdl_mixer). Reading and writing SDL_Surface from or to binary files works great, using SDL_LoadBMP_RW and SDL_SaveBMP_RW in case of SDL_RWFromFP. Unfortunately I cannot find the equivalent using MixChunk from SDL_mixer.h. I only found Mix_LoadWAV_RW (http://sdl.beuc.net/sdl.wiki/Mix_LoadWAV_RW) but no such Mix_SaveWAV_RW or so.

What's the way to write sounds into resource files?

Kind regards
Glocke

/EDIT: I am using C++ - sorry, I forgot to write this Very Happy
Glocke


Joined: 03 Feb 2013
Posts: 34
Hi,

I tried to write "alen" and "abuf" (as array using alen as length) to file. Reading works as well. But it's important to set "volume" to a value unequal to zero after reading.

Kind regards