I've been messing around with this lately in Audacity and a hex editor trying to figure out more about the .ddb. No guarantees any of this applies to anything but V3, as that's all I currently have access to. Here's what I've found:
The actual samples begin with SND (53 4E 44) and end with FRM2h, (46 52 4D 32 68 2C). If you take the stuff between those and put it in a new file, it will be just the samples.
I've also encountered FRM2 followed by other symbols, which seems to be related to something else, as they don't mark the end of samples, but I'm not yet sure what.
Edit: It might be a bit less straightforward than that, as I've been writing a program to extract samples from the .ddb and encountered some odd stuff. I have managed to use it to successfully extract a sample, but the program still needs a bit more work, and it might be a bit since I'm pretty new to coding.
Edit: Okay, disregard most of that stuff up there. It's only partially correct. Seems samples can end with FRM2-whatever, not just FRM2h,. Also, SND has to be at the beginning of the file for Audacity to read it properly as raw data, otherwise it's just static. Which doesn't make a lot of sense to me, but admittedly I have very little experience with this sound stuff.
Also, I can confirm that this applies to V2, V3, and V4 files. It works with V5 too, but the .ddb files are too big for my program to handle, and while I'm sure there's a way around that, I'm not good enough at this whole programming thing yet to know what it is.
Did anyone actually get this working? I'm having trouble with audacity importing it incorrectly.
The import settings should look like this:
Edit: Depending on what version of Vocaloid you're working with, you might want to make sure you have the right .ddb, as some have other .ddb files. The one you want should be (vocaloid name).ddb.