From owner-freebsd-questions Mon Jul 22 6:30:39 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C93C37B405 for ; Mon, 22 Jul 2002 06:30:32 -0700 (PDT) Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44C4043E42 for ; Mon, 22 Jul 2002 06:30:31 -0700 (PDT) (envelope-from stijn@pcwin002.win.tue.nl) Received: from pcwin002.win.tue.nl (orb_rules@localhost [127.0.0.1]) by pcwin002.win.tue.nl (8.12.4/8.12.3) with ESMTP id g6MDUGUR098499; Mon, 22 Jul 2002 15:30:16 +0200 (CEST) (envelope-from stijn@pcwin002.win.tue.nl) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.12.4/8.12.4/Submit) id g6MDUGSQ098498; Mon, 22 Jul 2002 15:30:16 +0200 (CEST) Date: Mon, 22 Jul 2002 15:30:16 +0200 From: Stijn Hoop To: "Christopher J. Umina" Cc: FreeBSD Question Mailing List Subject: Re: Mp3 Tags Message-ID: <20020722133016.GB4712@pcwin002.win.tue.nl> References: <20020722083723.A9211-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <20020722083723.A9211-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com> User-Agent: Mutt/1.4i X-Bright-Idea: Let's abolish HTML mail! Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 22, 2002 at 08:38:46AM -0400, Christopher J. Umina wrote: > Hi guys, >=20 > Is there a command that I can use to strip the tags off of Mp3's? > I want to strip the ID3v1 and ID3v2 tags out. Or does anybody have a clue > about how I could do it in C or C++? You could use the perl library /usr/ports/audio/p5-MP3-Info. The following snippet shows how I did it: # Now remove ID3v{1,2} tags my $tag =3D get_mp3tag($filename); if (defined($tag)) { # make a backup my $backupname =3D $filename . ".BAK"; system("cp", $filename, $backupname); my $bytes =3D remove_mp3tag($filename, "ALL"); if (!defined($bytes)) { # restore backup system("mv", "-f", $backupname, $filename); dowarn("could not remove ID3 tag from $path"); } elsif ($bytes =3D=3D -1) { # restore backup system("mv", "-f", $backupname, $filename); dowarn("no ID3 tag found in $path, should not happe= n"); } else { system("rm", $backupname); dowarn("mp3 changed ($path): tag of $bytes bytes " . "removed"); } } HTH, --Stijn --=20 In the force if Yoda's so strong, construct a sentence with words in the proper order then why can't he? --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9PAjnY3r/tLQmfWcRAuFSAJ0fRWARZlzwVp3Ds/9+X50DZDj19gCgjfC2 ANHhsz/R2RBe/L2t967xHKw= =u0ng -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message