I don't know how to compress audio of Broken sword 2

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
faramir1985
Posts: 1
Joined: Wed Dec 28, 2005 11:14 am

I don't know how to compress audio of Broken sword 2

Post by faramir1985 »

I don't know how to compress speech and music of Broken sword 2 with scumm tools

can you explain me

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

Re: I don't know how to compress audio of Broken sword 2

Post by eriktorbjorn »

faramir1985 wrote:I don't know how to compress speech and music of Broken sword 2 with scumm tools

can you explain me

thanks
Well, none of the ScummVM compression tools have a graphical user interface. They're meant to be run from a command line. How to do that depends on your operating system. Once you have a command-line, it should just be a matter of running the program, with the file to compress as the parameter. (There are a bunch of possible options. Running the program without any parameters should display a summary.)

Note that none of the compression tools actually know how to compress anything. All they know is how to take the file apart, invoke an external compression program, and then reassemble the compressed pieces into a new file. So for it to work, you will also need lame (for MP3), oggenc (for Ogg Vorbis) or flac (for FLAC).

In the case of Broken Sword 2, I'd advise against using FLAC since the "compressed" files end up being larger than the originals. :)
StubDoo
Posts: 8
Joined: Fri Dec 30, 2005 2:29 pm

Post by StubDoo »

I have a similar problem. I'm trying to compress the audio file so that it'll fit on a 1GB PSP memory card.

I'm using a Mac on OSX 10.4.3. I've made a fresh folder on the desktop of Broken Sword 2, called BS2. I've also dragged the speech1.clu away from the main folder to the desktop so I don't have to type a long path name.

1st thing I did was click compress_sword2 from the scummvm-tools-0.8.0 folder.
It gave this:

Code: Select all

Last login: Fri Dec 30 15:04:53 on ttyp1
Welcome to Darwin!
stuart-barretts-imac-g5:~ stuartbarrett$ /Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2; exit

Usage&#58; /Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2 <params> file.clu

Params&#58;
 --mp3        encode to MP3 format &#40;default&#41;
 --vorbis     encode to Vorbis format
 --flac       encode to Flac format
&#40;If one of these is specified, it must be the first parameter.&#41;

MP3 mode params&#58;
 -b <rate>    <rate> is the target bitrate&#40;ABR&#41;/minimal bitrate&#40;VBR&#41; &#40;default&#58;24&#41;
 -B <rate>    <rate> is the maximum VBR/ABR bitrate &#40;default&#58;64&#41;
 --vbr        LAME uses the VBR mode &#40;default&#41;
 --abr        LAME uses the ABR mode
 -V <value>   specifies the value &#40;0 - 9&#41; of VBR quality &#40;0=best&#41; &#40;default&#58;4&#41;
 -q <value>   specifies the MPEG algorithm quality &#40;0-9; 0=best&#41; &#40;default&#58;2&#41;
 --silent     the output of LAME is hidden &#40;default&#58;disabled&#41;

Vorbis mode params&#58;
 -b <rate>    <rate> is the nominal bitrate &#40;default&#58;unset&#41;
 -m <rate>    <rate> is the minimum bitrate &#40;default&#58;unset&#41;
 -M <rate>    <rate> is the maximum bitrate &#40;default&#58;unset&#41;
 -q <value>   specifies the value &#40;0 - 10&#41; of VBR quality &#40;10=best&#41; &#40;default&#58;3&#41;
 --silent     the output of oggenc is hidden &#40;default&#58;disabled&#41;

Flac mode params&#58;
 &#91;params&#93;     optional arguments passed directly to the encoder
              recommended is&#58; --best -b 1152

 --help     this help message


If a parameter is not given the default value is used
If using VBR mode for MP3 -b and -B must be multiples of 8; the maximum is 160!
logout
&#91;Process completed&#93;
I adapted the top line of what it says in terminal to:

Code: Select all

/Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2--vorbis-m speech1.clu
That said no file or directory found so I added the location of the speech1.clu file (which is a seperate file on the desktop):

Code: Select all

/Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2--vorbis-m/users/stuartbarrett/desktop/speech1.clu 
Still hasn't worked, again says no file.


So can anybody give some tips as to where I'm going wrong?
Or maybe even a line of code I can just copy and paste please?
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3558
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

StubDoo wrote:I adapted the top line of what it says in terminal to:

Code: Select all

/Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2--vorbis-m speech1.clu
That said no file or directory found so I added the location of the speech1.clu file (which is a seperate file on the desktop):

Code: Select all

/Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2--vorbis-m/users/stuartbarrett/desktop/speech1.clu 
Still hasn't worked, again says no file.


So can anybody give some tips as to where I'm going wrong?
Or maybe even a line of code I can just copy and paste please?
From that example, it looks as if you don't have any space between the command name and its parameters. In other words, you're trying to start a program called "compress_sword2--vorbis-m/users/stuartbarrett/desktop/speech1.clu" which is unlikely to exist, to say the least.

I'm also not sure what you're trying to do with the "-m".
StubDoo
Posts: 8
Joined: Fri Dec 30, 2005 2:29 pm

Post by StubDoo »

Re: why I added -m

I presumed that where it says:

Code: Select all

Vorbis mode params&#58; 
 -b <rate>    <rate> is the nominal bitrate &#40;default&#58;unset&#41; 
 -m <rate>    <rate> is the minimum bitrate &#40;default&#58;unset&#41; 
 -M <rate>    <rate> is the maximum bitrate &#40;default&#58;unset&#41; 
 -q <value>   specifies the value &#40;0 - 10&#41; of VBR quality &#40;10=best&#41; &#40;default&#58;3&#41; 
 --silent     the output of oggenc is hidden &#40;default&#58;disabled&#41; 
in the FAQ, I'd have to add the -m for the value, though looking at that I haven't set the rate anyhow.

Can you please advise of where the spaces should be in the command, as it's fairly apparent I have no idea what I'm doing :)

Thank you.
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3558
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

StubDoo wrote:Re: why I added -m

I presumed that where it says:

Code: Select all

Vorbis mode params&#58; 
 -b <rate>    <rate> is the nominal bitrate &#40;default&#58;unset&#41; 
 -m <rate>    <rate> is the minimum bitrate &#40;default&#58;unset&#41; 
 -M <rate>    <rate> is the maximum bitrate &#40;default&#58;unset&#41; 
 -q <value>   specifies the value &#40;0 - 10&#41; of VBR quality &#40;10=best&#41; &#40;default&#58;3&#41; 
 --silent     the output of oggenc is hidden &#40;default&#58;disabled&#41; 
in the FAQ, I'd have to add the -m for the value, though looking at that I haven't set the rate anyhow.
Only if, for some reason, you are unhappy with whatever the default value is.
StubDoo wrote:Can you please advise of where the spaces should be in the command, as it's fairly apparent I have no idea what I'm doing :)
Between each part of the command, e.g. it's "compress_sword2 --vorbis speech1.clu" instead of "compress_sword2--vorbisspeech1.clu" Of course, that assumes that "compress_sword2" is in your search path, and that speech1.clu is in the current directory. If both the program and the file is in the current directory, "./compress_sword2 --vorbis speech1.clu" should work. (In your example, you gave the full path to the program. That should work, too.)

Assuming, of course, that oggenc is installed, since compress_sword2 invokes that to do the actual compressing.
StubDoo
Posts: 8
Joined: Fri Dec 30, 2005 2:29 pm

Post by StubDoo »

Well I think I have Oggnec installed.
I clicked your link just above, and from there chose Ogg Drop from this list. That the right one?

I also don't really understand the terminology used when you say
"If both the program and the file is in the current directory, "./compress_sword2 --vorbis speech1.clu" should work. (In your example, you gave the full path to the program. That should work, too.)"
For ease of use I've made a new Broken Sword 2 folder on the desktop (called BS2), so that any alteration I do don't affect my working OSX version. The file compress_sword2 is still in the scumm tools folder, which again is on the desktop.
I've then dragged the file "speech1.clu" away from the cluster folder inside the BS2 folder, so that I only have to type a short path to find it.
Could this removal have stopped it from working?

Thanks for the help BTW.

Code: Select all

/Users/stuartbarrett/Desktop/scummvm-tools-0.8.0/compress_sword2 --vorbis speech1.clu 
is what I've just tried, with the speech1.clu file inside the scummvm-tools-0.8.0 folder. This time it says it can't open file speech1.clu
fingolfin
Retired
Posts: 1452
Joined: Wed Sep 21, 2005 4:12 pm

Post by fingolfin »

If you have copied the .clu file into the tools dir, then these two commands should work:

Code: Select all

cd /Users/stuartbarrett/Desktop/scummvm-tools-0.8.0

./compress_sword2 --vorbis speech1.clu 
StubDoo
Posts: 8
Joined: Fri Dec 30, 2005 2:29 pm

Post by StubDoo »

I have definitely moved the speech1.clu, as well as the speech2, music1 and music2.clu files into the "scummvm-tools-0.8.0" folder.

Tried that command in two ways in OSX terminal.

If I go file>new command it seems to start something, and says process complete.
However, what it gives is this:
Image
The .idx is 32kb, .dat is 0kb and .wav is 64-192kb on each of the speech.clu's
The .idx is 32kb, .dat is 0kb and .wav is 768kb-1.6m on each of the music.clu's

The files were originally called tempfile.dat etc, so I renamed them correctly to speech1.dat, speech1.wav etc, and put them back in the correct cluster folder.

If I go file>new shell in terminal it gives this:

Code: Select all

/Desktop/scummvm-tools-0.8.0 stuartbarrett$ ./compress_sword2 --vorbis speech1.clu 
sh&#58; line 1&#58; oggenc&#58; command not found
Got error from encoder. &#40;check your parameters&#41;
Encoder Commandline&#58; oggenc --quality=3 --output=tempfile.ogg tempfile.wav 
stuart-barretts-imac-g5&#58;~/Desktop/scummvm-tools-0.8.0 stuartbarrett$ 
It's weird, it seems to have worked for some but not fully.
For example on starting a new game I can hear the music and SFX, but no speech. From a later save file I can only hear the odd SFX, like when I ring the bell on the boat, but no SFX sound of birds and the sea or music, like I can hear when I play the same save file on the Mac.

I have toggled the music, speech etc on and off, as well as adjusting the volume. The volume on the PSP is also at it's highest point.

Any idea?
Post Reply