HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: metrom on 2001-10-14 23:42:51

Title: Tagging
Post by: metrom on 2001-10-14 23:42:51
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?
Title: Tagging
Post by: YinYang on 2001-10-15 09:16:20
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  )

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.
Title: Tagging
Post by: metrom on 2001-10-16 23:37:57
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.
Title: Tagging
Post by: YinYang on 2001-10-17 00:50:28
If the writer of this nifty little script want to claim ownership, please do! Basically I only added the unlink line

*******

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
Title: Tagging
Post by: greycat on 2001-10-31 18:11:22
The general way is with backquotes.

Code: [Select]
#!/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.
Title: Tagging
Post by: qristus on 2001-10-31 19:03:06
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 

Using >> to append will work fine.
Title: Tagging
Post by: YinYang on 2001-11-04 13:57:06
Quote
Originally posted by greycat
The general way is with backquotes.

Code: [Select]
#!/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"
Title: Tagging
Post by: Peter Harris on 2001-11-05 18:01:35
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.