Previous Page | Next Page

by hcs at 8:41 PM EDT on April 15, 2009
Revolution B 0.2 on the ripping tools page.
See history for changes, importantly it now produces a warning if the loop start is not on a block boundary, and reports how many samples of silence can be added to the beginning to resolve the problem.
by furrybob at 7:31 PM EDT on April 16, 2009
I've made a batch file that automatically converts any audio file read by goldwave or vgmstream to brstm files

problem is it's just one step away from being fully automated

my current code is:
for %%a in (*.adx) do (
Setlocal EnableDelayedExpansion
vgmstream -o "%%~na.wav" -l 1 -f 0 "%%a"
@set /P end=End Loop Point:
@set /P start=Start Loop Point:

insert random file processing commands here

dspadpcm -e "song_l.wav" "song_l.dsp" -l!start!-!end!
dspadpcm -e "song_r.wav" "song_r.dsp" -l!start!-!end!

so it shows up like this on the command prompt screen:

decoding Air Fleet.adx
sample rate 48000 Hz
channels: 2
loop start: 1172448 samples (24.43 seconds)
loop end: 3663259 samples (76.32 seconds)
stream total samples: 3896772 (81.18 seconds)
encoding: CRI ADX 4-bit ADPCM
layout: interleave
interleave: 0x12 bytes
metadata from: CRI ADX header type 04
samples to play: 3663259 (76.32 seconds)
End Loop Point:

And then i have to manually enter the loop points

Is there any way that vgmstream can output the loops as variables or something that would fully automate this process? I'd really like being able to simply drop this batch file in a folder full of mp3s or adxs, run it and come back to a folder full of brstms
by furrybob at 6:53 PM EDT on April 23, 2009
basicly I just want an option to output loop points as variables so I can call them later in a batch file
by hcs at 8:36 PM EDT on April 23, 2009
Closest we have is the -x and -g options, which print out command lines for adxencd and oggenc with loop stuff. But what kind of loop points do you expect for mp3s?
However, this won't help with getting proper loop points, you'd need a preprocessor that pads out the file according to where the loop start is supposed to be. I could throw together something that does this, and I've been thinking of it, might get to it shortly.
by furrybob at 9:10 PM EDT on April 23, 2009
basic steps a simple automatic converter batch file would take with files that already have loop points:

use vgmstream to decode file up to one second past the end loop point, and output loop points to command prompt
have command prompt output loop points to external script
adjust loop points, making the start loop point a multiple of 14336 by finding the next multiple of 14336 and increasing both loop points accordingly
eg:
start: 97512 -> 100352
end: 724679 -> 727519
input new loop points to command prompt
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
make brstm file with revb

If you wanted to add custom loop points to an mp3 or similar nonlooped audio file you would:

convert file to .wav with goldwave
enter custom loop points manually
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
write brstm header with revb
If the start loop point is divisible by 14336(something like a $start/14336 = int($start/14336)), you're finished. If it's not:

use vgmstream to decode file up to a second past the end loop point, and output loop points to command prompt
have command prompt output loop points to an external script
adjust loop points to have the start loop point a multiple of 14336
input new loop points to command prompt
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
make brstm file with revb
(yes you're encoding twice, but unless you get brawl compatable loop points before hand it's the only method I could think of)



edited 9:12 PM EDT April 23, 2009

edited 10:56 PM EDT April 23, 2009
by furrybob at 11:50 PM EDT on April 28, 2009
but the -x and -g options don't actually tell adxencd or oggenc to encode the output dump.wav file, they just show you the commands to do so (if i'm wrong tell me, that's what it does on my computer)

And if you decide to add an option to output the loop points (which i really hope you do) could you output the total number of samples in a song and whether it loops or not as a 1 or 0? I'd need those to make the little brstm converter batch file I'm making fully automatic and virtually n00b proof.
If I had that the batch file would be able to convert any file readable by vgmstream or goldwave into a brstm with proper loop points automaticlly
by hcs at 12:10 AM EDT on April 29, 2009
The idea of the -x and -g option is that you decode with test.exe, but you direct the output to a batch file, like:
test.exe -x fred.dsp out.wav >> blah.bat
And then you run blah.bat. >> appends to the end of a file. I'd probably do something similar if adding a dspadpcm output, and it'd have the loop params or not according to that. There'd also be a switch to enable the loop aligning.
by furrybob at 6:57 PM EDT on April 29, 2009
oh, I didn't think of directing the output to another batch file

The problem with having an adxencd, oggenc, and dspadpcm output is that it's not as versatile as simply outputing loop points as variables.
If you want to put loop points into your own script instead of using test.exe's predetermined commands, you can't.

I would suggest an option that does something like
test.exe -option file.adx >> 1.bat
which would output that file's information which might look like: "set loop=1 & set lstart=103944 & set lend=4839137 & set ttlsamp=4839137" to 1.bat

then have a "call 1.bat" in your original batch file to import the variables which you can then use in your script

edited 7:00 PM EDT April 29, 2009
by hcs at 7:41 PM EDT on April 29, 2009
Fair enough, that much can be done easily. And that leaves the loop aligning as a more general mechanism (some program that works directly on WAVs).
by furrybob at 7:00 PM EDT on April 30, 2009
Thanks a whole lot for this
And if it's not too hard to do, could you also output the number of channels?

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source