Language…
6 users online: 1392year, Anas, CONLUSH666, Firstnamebutt, kirito86, Zavok - Guests: 173 - Bots: 360
Users: 64,795 (2,380 active)
Latest user: mathew

AddmusicK error .brr sample

Code
The sample "samples/.\sfk\sfk.brr" was of an invalid length (the filesize - 2 should be a multiple of 9).  Did you forget the loop header?


I'm unsure of what this means, but I made .brr sample from a .wav and get this error. Did I forget something?
First, ensure your loop points and length of wav file were a multiple of 16, because this is a limitation of the BRR format which must be met for compression to be successful.
You do need to add a loop header to your BRR files once they are created. To do this, follow these steps:
1. Go into a calculator, take the loop start point of your wav file. In my case, the loop start was 800. Multiply that number by 0.5625. When I do that, I get 450. If you don't get a whole number, it means your loop is not valid and you'll have to try again.
2. Convert this number, in my case 450, to hexidecimal. To do this, you can press alt 3 to get to programmer view, then choose decimal, then type 450 and switch the display to hex. For this example, the hex conversion is 1c2.
3. Now, mentally add zeroes to the beginning so that the hex number is 4 digits long. Since I got 1c2, it will now become 01c2.
4. Reverse the pairs. So instead of 01c2, it's c201.
5. You'll need to use a hex editor like HXD, but anything will do. In your editor, open the brr, go to the very beginning of the file, and use the insert function. Make sure the editor is accepting hex digits and not strait text, and type in the hex from the previous step, so c201. Don't overwrite anything, just insert! Once this is done, save and it should work in AMK.
6. If the loop sounds wrong, you may have to redo the calculation but add 16 to the initial number. So instead of starting with 800, start with 816. Alternatively, you can add 9 to the first byte. So instead of inserting c201, you could just add 9 and get cb01 and try that.
I cannot be credited for figuring this out, someone wrote a thing, I believe on here, way back. I don't know who it was or where to find it though.
Make more of less, that way you won't make less of more!