IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Tagging
metrom
post Oct 14 2001, 23:42
Post #1





Group: Members
Posts: 39
Joined: 2-October 01
Member No.: 166



Im going to rip with EAC, and use CDDB for info.
But EAC isn't supporting the oggcommet system, (they say it will in the next release).
What other easy way is there to commet hole albums with the same comment?
Go to the top of the page
+Quote Post
YinYang
post Oct 15 2001, 09:16
Post #2





Group: Members
Posts: 371
Joined: 29-September 01
Member No.: 45



Perl (or other programming language) scripts

A kind person on the Vorbis mailing list once sent me a small Perl-script that works perfect for me (after a bit of personal tweaking smile.gif )

Also made we want to change to Linux

I rip from EAC to wav in a folder and then let the script do the encoding, tagging, and deleting of source-files in that folder. Works like a charm.
Go to the top of the page
+Quote Post
metrom
post Oct 16 2001, 23:37
Post #3





Group: Members
Posts: 39
Joined: 2-October 01
Member No.: 166



A Perl scrips sounds interresting.
Can you come up whit a link or something?
I guess the whole code is a bit large to paste into this forum.
Go to the top of the page
+Quote Post
YinYang
post Oct 17 2001, 00:50
Post #4





Group: Members
Posts: 371
Joined: 29-September 01
Member No.: 45



If the writer of this nifty little script want to claim ownership, please do! Basically I only added the unlink line biggrin.gif

*******

opendir DIR, '.' or die "Cannot open directory because $!n";

@initdir = readdir DIR;
closedir DIR;

foreach $me (@initdir) {
push @dir, $me if ($me =~ /.wav$/)
}

foreach $_ (@dir) {
$wavfile = $_;
s/.wav$//;
$filename = $_;
s/^(.+) - (.+) - (d+) - //;
$art = $1;
$alb = $2;
$num = $3;
system '"C:Program FilesOgg Vorbis Encoderoggenc.exe"',
' -b ', '128',
' -N ', $num,
' -t ', '"'.$_.'"',
' -l ', '"'.$alb.'"',
' -a ', '"'.$art.'"',
' -d ', '2001',
' -o ', '"'.$filename.'.ogg"',
' "'.$wavfile.'"';
unlink $wavfile;
}

closedir DIR;

*******

(I edit the bitrate and/or the year accordingly)

Unfortunately I've been too lazy to find out how (I'm a programming newbie without the programming bug) to get the data-output from oggenc (coding time, coding speed, bitrate) appended/sent to a text file. If I could do that it would be perfect for me biggrin.gif
Go to the top of the page
+Quote Post
greycat
post Oct 31 2001, 19:11
Post #5





Group: Members
Posts: 1
Joined: 30-September 01
Member No.: 76



The general way is with backquotes.

CODE
#!/usr/local/bin/perl -w



$foo = `mycommand`;

print $foo;


You'd use this instead of "system", to run your oggenc command and capture the output in a perl variable. Then you can do whatever you like with the information.

If, however, all you want to do is append to a text file, then you can use the ">>" redirection operator (in a Unix shell). "echo hello world >>file" will append to the end of "file". I don't know whether the NT CMD.EXE has that operator, and I think that the DOS COMMAND.COM doesn't.
Go to the top of the page
+Quote Post
qristus
post Oct 31 2001, 20:03
Post #6





Group: Members (Donating)
Posts: 132
Joined: 15-October 01
From: Norway
Member No.: 297



QUOTE
Originally posted by greycat
If, however, all you want to do is append to a text file, then you can use the ">>" redirection operator (in a Unix shell).  "echo hello world >>file" will append to the end of "file".  I don't know whether the NT CMD.EXE has that operator, and I think that the DOS COMMAND.COM doesn't.


Both NT's CMD.EXE and DOS's COMMAND.COM support the redirection operators, I used to use them a lot in batch scripts smile.gif

Using >> to append will work fine.
Go to the top of the page
+Quote Post
YinYang
post Nov 4 2001, 14:57
Post #7





Group: Members
Posts: 371
Joined: 29-September 01
Member No.: 45



QUOTE
Originally posted by greycat
The general way is with backquotes.

CODE
#!/usr/local/bin/perl -w



$foo = `mycommand`;

print $foo;


You'd use this instead of "system", to run your oggenc command and capture the output in a perl variable.  Then you can do whatever you like with the information.

If, however, all you want to do is append to a text file, then you can use the ">>" redirection operator (in a Unix shell).  "echo hello world >>file" will append to the end of "file".  I don't know whether the NT CMD.EXE has that operator, and I think that the DOS COMMAND.COM doesn't.


Thanks for the advice. Unfortunately, me being the Perl-idiot, I couldn't get it to work.
I tried something like (for adding to a textfile)

open(loggie, ">> Encoding.log");
and
$status = ` '"C:Program FilesOgg Vorbis Encoderoggenc.exe"',
' -b ', '128',
' -N ', $num,
' -t ', '"'.$_.'"',
' -l ', '"'.$alb.'"',
' -a ', '"'.$art.'"',
' -d ', '2001',
' -o ', '"'.$filename.'.ogg"',
' "'.$wavfile.'"' `;

print ($status);
close(loggie);

*****
Didn't work at all. Can somebody be as kind as to enlighten me as to what I'm doing wrong? Basically i just want the final output from each encoding to be appended in a textfile named "Encoding.log" smile.gif
Go to the top of the page
+Quote Post
Peter Harris
post Nov 5 2001, 19:01
Post #8





Group: Members
Posts: 93
Joined: 17-October 01
Member No.: 310



QUOTE
print ($status);

ITYM print loggie, $status;

QUOTE
Didn't work at all. Can somebody be as kind as to enlighten me as to what I'm doing wrong?


Possibly nothing. The trouble is, oggenc doesn't use stdout, it uses stderr.

Somebody should probably patch oggenc and let the vorbis-dev people know about it. smile.gif
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 15:24