Extracting sound from Alex Builds His Farm

Discuss tools to aid in the modification and running of Rayman games.

Moderators: English moderators, Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Post Reply
NXTtrain
Électoon
Posts: 1
Joined: Fri Dec 02, 2022 9:20 pm
Tings: 5

Extracting sound from Alex Builds His Farm

Post by NXTtrain »

I have a (dutch) copy of the game "Alex builds his farm" for PC. I'd like to extract (some of) the audio files, but I have no idea how to get it done. Apparantly the game uses the same engine as Rayman 2, so some of the tools do kinda work.

Unfortunately, kinda works isn't good enough to get usable audio files, so maybe some experts can help me along?
ElZboub
Otto Psi
Posts: 51
Joined: Sun Jun 12, 2016 4:57 pm
Tings: 6350

Re: Extracting sound from Alex Builds His Farm

Post by ElZboub »

Personally I used tonictac to extract the music from the game. I don't remember if the software also extracted the other ambient sounds or the voices though, but I think they must use the same file formats, so it should work. The software only works via the command prompt though, but it's pretty easy to use.

https://mega.nz/file/A9AhELgB#jiKbyqi49 ... XJFhWgutUA
AlphaYellow
Lums Bleu
Posts: 21
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 105

Re: Extracting sound from Alex Builds His Farm

Post by AlphaYellow »

ElZboub wrote: Thu Jan 12, 2023 9:41 pm Personally I used tonictac to extract the music from the game. I don't remember if the software also extracted the other ambient sounds or the voices though, but I think they must use the same file formats, so it should work. The software only works via the command prompt though, but it's pretty easy to use.

https://mega.nz/file/A9AhELgB#jiKbyqi49 ... XJFhWgutUA
Please explain how it works, that's the most important part.
ElZboub
Otto Psi
Posts: 51
Joined: Sun Jun 12, 2016 4:57 pm
Tings: 6350

Re: Extracting sound from Alex Builds His Farm

Post by ElZboub »

- You must copy the files present in "Alex Builds His Farm\Gamedata\World\Sound" and that you paste them in the folder "tonictac"
- Once you have pasted them, launch the Windows command prompt by typing "cmd" in the search bar of Windows
- In the CMD you should have a command line like this : "C:\Users\<YourPCName>"
- Now you have to go to the place where you put the "tonictad" folder. If you put it for example in "Downloads", you must type "cd C:\Users\<YourPCName>\Downloads\tonictac"
- Then you must type "tonictac.exe b <NameOfTheFileYouWantToExtract>.bnm" and the software should extract you the musics/sounds in the form of files .wav
- If the format of the file you want to extract is not .bnm but .apm, you have to replace the "b" in the command with an "a", otherwise it won't work

It seems complicated at first, but in the end you only have to enter two commands to extract the files
Attachments
Sans titre.png
Sans titre.png (35.3 KiB) Viewed 3395 times
AlphaYellow
Lums Bleu
Posts: 21
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 105

Re: Extracting sound from Alex Builds His Farm

Post by AlphaYellow »

ElZboub wrote: Sun Jan 29, 2023 4:43 pm - You must copy the files present in "Alex Builds His Farm\Gamedata\World\Sound" and that you paste them in the folder "tonictac"
- Once you have pasted them, launch the Windows command prompt by typing "cmd" in the search bar of Windows
- In the CMD you should have a command line like this : "C:\Users\<YourPCName>"
- Now you have to go to the place where you put the "tonictad" folder. If you put it for example in "Downloads", you must type "cd C:\Users\<YourPCName>\Downloads\tonictac"
- Then you must type "tonictac.exe b <NameOfTheFileYouWantToExtract>.bnm" and the software should extract you the musics/sounds in the form of files .wav
- If the format of the file you want to extract is not .bnm but .apm, you have to replace the "b" in the command with an "a", otherwise it won't work

It seems complicated at first, but in the end you only have to enter two commands to extract the files
I did it all correctly and extracted the two required DLL files the extractor keeps asking for, and when I try to extract Bnk_1.bnm, it gives me this error, but for smaller files it works just fine, just when the source file is big enough it says there isn't enough memory or external files are missing lol, how do I solve this?

Captura de ecrã 2023-02-11 162239.png
Captura de ecrã 2023-02-11 162239.png (54.85 KiB) Viewed 3039 times
AlphaYellow
Lums Bleu
Posts: 21
Joined: Tue Aug 17, 2021 12:42 am
Contact:
Tings: 105

Re: Extracting sound from Alex Builds His Farm

Post by AlphaYellow »

PluMGMK wrote: Sat Feb 11, 2023 6:10 pm How much RAM do you have?
8 GB
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: Extracting sound from Alex Builds His Farm

Post by PluMGMK »

Hmm, then that's probably not the problem then :oops2: I'm not familiar with this software so I'm not sure what would make it error out like that…
deton24
Garatta Ciatik
Posts: 1141
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8652

Re: Extracting sound from Alex Builds His Farm

Post by deton24 »

Maybe try to launch it in Powershell or copy the libraries from the English version if they differ.
The tool was written for Tonic Trouble, and if it didn't have such big segments (or English version of Alex Builds His Farm), that might be a new problem they didn't take under consideration, because it worked before.

If the problem happens just for BNM files, I believe there should be some other extractor able to do the job.

For BNM files you can use this extrator:
http://homepage.tinet.ie/~expatjen/files/f1bnm.zip
Droolie
Mr Sax
Posts: 5162
Joined: Wed Apr 20, 2005 7:31 pm
Tings: 61830

Re: Extracting sound from Alex Builds His Farm

Post by Droolie »

Sadly it's not just Alex Builds His Farm...
The format is also used by Hype: The Time Quest (PC). I like that soundtrack a lot so I tried messing with this tool today...

Turns out it crashes on the first file of every BNM file. Okay, so I modified an existing QuickBMS script to automate extracting MPX/MPU/MPD files.
After that, tonictac's errors are gone, but still only about half of the MPX files are converted correctly - the rest output silence for the duration of the track. So sadly, it's currently impossible to rip the soundtrack of that game. I imagine it's similar for Alex Builds His Farm.

Of course, there's a PS2 version too, but that uses 22kHz tracks, and the PC version's MPX files are 44kHz. And Alex Builds His Farm and Laura's Happy Adventures don't have other versions anyway.

It seems this whole UbiSoft MPEG mess just won't end... :(

EDIT 1 > Ok, it seems like the other half of the MPX files are converted correctly only if they're extracted from the BNM with the "b" bank option. But the banks need to be edited manually first because it isn't possible to extract any of them. I'll just see if I can edit & recompile tonictac to fix this, that'd be the easiest solution.

EDIT 2 > After I sank into a pit of depression because I kept struggling to recompile this program, Spitfire_x86 helped out and rewrote part of it, fixing the compilation issue. This was a huge help and I cannot thank him enough!!! :D After that I was able to debug the code and fix some big issues that prevented it from working on Hype. It now works flawlessly - and I would be very surprised if it didn't have some issues with Tonic Trouble before... For Hype, the offset from which it tried to read files was almost always incorrect, and the "theme merging" tool (the author's attempt at merging segments while exporting) sometimes caused entire tracks to be ignored while exporting as well as just guessing the segment order??? As a result I've disabled that, which means more segments - but at least you can control how they are merged now.
I will share the updated tool here later after I test it with more games. :)

EDIT 3 > So I was told we have the source code for Ubisoft's MPEG algorithm. I will probably look into that and try reimplementing it in the future (in a few months maybe). In the meantime, I'll release the updated version of tonictac and its source: https://app.box.com/s/z7iiex4bzo23rppg81ynd64dzq9ln7rs
To use it, just put the exe, DLLs and bat file in the sound directory of the game and run bnm2wav.bat. It'll create a ton of wav files. Some of them are converted from ADPCM, some are converted from MPEG. This works on most(/all?) games that use BNM files.
For the files converted from ADPCM, you should know that the game DLLs always output them at 22.05kHz even if a different sample rate is specified, and it is better to convert them using another tool (like vgmstream) instead. MPEG files might have quality loss too, I will look into that further later.

Again, a HUGE thanks to Spitfire_x86: he made the detours version of this tool which allowed me to build on that. :)
HeroHype
Électoon
Posts: 3
Joined: Tue Jun 20, 2023 11:23 am
Tings: 15

Re: Extracting sound from Alex Builds His Farm

Post by HeroHype »

Does this also work to encode WAV files back to BNM? I just saw this post and weren't able to get this up and running :)
Post Reply