Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a loop #2

Open
Badore90 opened this issue Jul 24, 2023 · 8 comments
Open

Setting a loop #2

Badore90 opened this issue Jul 24, 2023 · 8 comments

Comments

@Badore90
Copy link

Badore90 commented Jul 24, 2023

I'm editing some VAG files from Dragon Ball Z Budokai 1.

There's one sound that's too loud (you can't hear musics or voices) so I decreased its volume. Now the problem is that it is a looped sound and I don't know how to set it back as it was, the sound plays one and doesn't loop at all.

I tried either setting the loop off-set to 0 and to 97328 (that's the last sample of this audio file).
It works with samples, right? Or should I put some address?

@jmarti856
Copy link
Member

Hello!

If you are encoding a sound file that has two channels, remember to split them in two files and encode them separately (this tool doesn't encode stereo files, only mono).

About looping, if you set the parameter "-L" at the end, in a PS2, the sound should play with the loop from start to end.

If you want to set a loop in a specific sample, this tool also reads the "Sample (smpl)" chunck of the WAV files, so you can set the loop point using SoundForge for example, and the tool will automatically read the loop position.

The same if you have an AIFF file with the "Mark" chunk, the tool will read the start and end positions for the loop.

Hope it helps!!

@Badore90
Copy link
Author

Hello!

If you are encoding a sound file that has two channels, remember to split them in two files and encode them separately (this tool doesn't encode stereo files, only mono).

About looping, if you set the parameter "-L" at the end, in a PS2, the sound should play with the loop from start to end.

If you want to set a loop in a specific sample, this tool also reads the "Sample (smpl)" chunck of the WAV files, so you can set the loop point using SoundForge for example, and the tool will automatically read the loop position.

The same if you have an AIFF file with the "Mark" chunk, the tool will read the start and end positions for the loop.

Hope it helps!!

Thank you for the answer!

The sound is mono. I'm using the first revision of your program 'cause i find it easier with the frontend. I'll try as you said.

I'm not modding the file in any way other than decreasing the volume using Audacity. I need it to loop exactly as it originally was, I'm pretty sure it is simply from beginning to end.

@Badore90
Copy link
Author

Just tried and the loop worked! I wonder why with the first version of the tool it didn't, it isn't 0 the off-set value for beginning to end loop?

Also I need the original version of the tool for Decoding. With the new version it says format unknown.

@Badore90
Copy link
Author

This is the original:

3.mp4

This is after decreasing the volume:

2.mp4

The loop starts when Tensing said (...You sacrified yourself for...) "Me". As you can hear looping from beginning to end isn't correct, the original is looped differently.

It is possible to check the original loop somehow? I'm not changing the sound lenght, samples are the same, if I know where to find the loop value I'll make sure to do it correctly.

Otherwise I can approximate it by ear. I use Audacity, what should I do for AIFF2VAG to read the loop I want?

@Badore90
Copy link
Author

Badore90 commented Jul 26, 2023

Checking with the hex-editor I see that the only difference between setting the loop with first or with last version of the program is one single byte in the second column of the last line.

With the old version it is 02 (as in the entire column) while with the new rev. is 03 (like in the original VAG). This is the only difference, so it must be this single byte that prevents the old version to correctly set a working loop.

Btw, even if with the new version the loop works, it is different from the original VAG, I don't know why, maybe it is not even related to the program, these VAGs work in strange ways.

When you set the loop, the entire second column from third to penultimate line is 02. On second line is 06, while on the original VAG is 02 also on second line. However changing it the loop doesn't work at all.

@Badore90
Copy link
Author

If you want to set a loop in a specific sample, this tool also reads the "Sample (smpl)" chunck of the WAV files, so you can set the loop point using SoundForge for example, and the tool will automatically read the loop position.

Ok I downloaded Sound Forge. I'm able to set the loop for Sound Forge to read it but I don't know how to implement the smpl into the wav. I don't see any option about it when exporting.

@Badore90
Copy link
Author

Badore90 commented Jul 29, 2023

I solved with Awave Studio.

It encodes exactly as AIFF2VAG (i.e. 2 files with no loop are bit identical) but allows to set beginning and end loop samples (in this case I needed to begin at 13832).

@jmarti856
Copy link
Member

Sorry for my last reply, I've been in rest these days.
Glad that you could get it working, I've been using this tool for encoding the audio and musics for another PS2 game and I didn't have any problems, with the loop points.

If you use SoundForge, you need to add markers, the smpl chunk is added automatically to the WAV when saving the changes. The AIFF2VAG tool, doesn't have a parameter where you can specify the sample in where the loop starts, if you add -L the audio will loop from start to end, if you want to specify another position that is not the first sample, you must use the SMPL chunk or an AIFF file with markers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants