Programming Sound Extracting with the ScummVM API

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Programming Sound Extracting with the ScummVM API

Post by michaelklaube »

Dear people in this forum,

I want to extract the sounds/music of various owned scumm Games and dowloaded the source code and built it via terminal with my mac.

I then saw through the various directories in the source code folder in order to find the entry point for the sound processing.

But now I have the problem that I can't find the approriate places to look for.

One thing I found for sound aspects is the AudioBufferCallback for CoreAudio processing where I could grab the bytes that are generated in order to push them to the sound hardware and write them to files.

But I need to play the actual game through in order to reach all the sounds.

Can anybody give me a hint on where to start looking for in order to extract the midi or aiff sounds?

Please help me:)
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

Let's be more specific:

I want to extract the music from the games via ScummVM API.
User avatar
sev
ScummVM Lead
Posts: 2059
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Post by sev »

There is no such thing as ScummVM API.

But if you're talking about OSystem, take a look at backends/mixer/sdl/sdl-mixer.cpp You will need to inject your code into callbacks.


Eugene
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3360
Joined: Mon Oct 31, 2005 7:39 am

Re: Programming Sound Extracting with the ScummVM API

Post by eriktorbjorn »

michaelklaube wrote: Can anybody give me a hint on where to start looking for in order to extract the midi or aiff sounds?
It would depend on the exact game, since each game engine has its own way of storing things.
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

Thanks for your replies!

I was thinking of parsing the LFL files and extracting the music e.g. for Zak or Indy 3.

I believe there must be some Manager who can parse these resources.

PS: I am talking about ScummVM API cause it's definitely an API which third parties could use, ain't it?
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

Hopefully you can remember Scumm Revisited. I want to do the same, but on my mac with the ScummVM Source.
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3360
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

michaelklaube wrote: I was thinking of parsing the LFL files and extracting the music e.g. for Zak or Indy 3.
I'm not sure off-hand, but I'd start looking in engines/scumm/sound.cpp. Specifically the playSound() and readSoundResource() functions, though they're a pretty big since they have to deal with so many different formats from so many different games.
digitall
ScummVM Developer
Posts: 1053
Joined: Thu Aug 02, 2012 1:40 pm

Post by digitall »

michaelklaube: I am unsure what you are doing exactly, but you should be aware that extracting the music for anything other than personal use could result in legal problems. Please see:
http://wiki.scummvm.org/index.php/HOWTO-Fangames
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

You're right, but the only thing I want to do is to add the aiff/mid files to my iTunes Library. I hope this is allowed.
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

There's a dedicated site for all of the Lucasarts / Disney adventures, which contains all of their music scores:

http://soundtracks.mixnmojo.com/

There's a similar site for all of the Sierra games:

http://queststudios.com/sierra/sierra.html

There's also James Woodcock's music enhancement project, for a lot of the non-Lucasarts, non-Sierra adventures:

http://www.jameswoodcock.co.uk/content/ ... t-project/

So, check these sites out first, chances are that a lot of the music scores you're looking for are there already.
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

The links are okay. But I want to do it by myself.
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

michaelklaube wrote:The links are okay. But I want to do it by myself.
In this case you'll have to follow eriktorbjorn's advice and look at engines/scumm/sound.cpp, engines/scumm/resource.cpp and write your own code to extract all the resources you want.
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

Thanks for all the replies!
michaelklaube
Posts: 33
Joined: Fri Feb 01, 2013 3:36 pm

Post by michaelklaube »

I've set up my own Xcode project and the compilation works, but now I get some linker errors like that:

Undefined symbols:
"Scumm::ScummEngine_v72he::readArrayFromIndexFile()", referenced from:
vtable for Scumm::ScummEngine_v100hein scumm.o
vtable for Scumm::ScummEngine_v99hein scumm.o
vtable for Scumm::ScummEngine_v72hein scumm.o
vtable for Scumm::ScummEngine_v90hein scumm.o

The symbol does definitely exist, but now I don't really know how to proceed. Can somebody help me?
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

michaelklaube wrote:I've set up my own Xcode project and the compilation works, but now I get some linker errors like that:

Undefined symbols:
"Scumm::ScummEngine_v72he::readArrayFromIndexFile()", referenced from:
vtable for Scumm::ScummEngine_v100hein scumm.o
vtable for Scumm::ScummEngine_v99hein scumm.o
vtable for Scumm::ScummEngine_v72hein scumm.o
vtable for Scumm::ScummEngine_v90hein scumm.o

The symbol does definitely exist, but now I don't really know how to proceed. Can somebody help me?
Are you really sure that they exist? It might be that you miss to define some macros like "ENABLE_HE" or similar which our build system would define to enable such code. You should really make sure to define the same macros as our configure/make based build system does.
Post Reply