⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fixrm.prl

📁 about sound recognition.i want to downlod
💻 PRL
字号:
#!/usr/local/bin/perl

#  fix rm files that were corrupted in recording
#  chops out a number of samples from the (coded) files
#   
#  usage: fixrm.prl corruptlist dataroot
#
#  where:       -corruptlist is a file with each list containing the
#                       corrupt_file_name corrupt_start corrupt_end
#               -dataroot is the root directory for the files in corruptlist
#
# the script moves the original file to the same name with 
# .orig added to the name
#
# Copyright (c) Phil Woodland, 1993
# Last Updated 14/5/93
#
# convert to perl by TL 7/1998
#

if ( $#ARGV != 1 ) {
   die "usage: fixrm.prl corruptlist dataroot\n";
}

$Corrupt=$ARGV[0];
if (! -f $Corrupt) {
   die "fixrm: corrupt list $Corrupt not found\n";
}

$Data_root=$ARGV[1];
if (! -d $Data_root) {
   die "fixrm: Invalid dataroot directory $Data_root\n";
}

open(CORRUPTFILE,"<$Corrupt") or die "Can't open corrupt list file $Corrupt\n";
while (<CORRUPTFILE>) {
	/^\s+$/ && next;        # skip an empty line
	s/\s+/ /g;              # turn one or more white spaces into a space
	($name, $first, $last) = split(" ",$_);
	$fullname = "$Data_root\\$name";
	$backup = "$fullname".".orig";
	if ( -f $backup ) {
		print "$fullname already processed\n";
	}
	else {
		print "Deleting frames $first to $last of $fullname\n";
		system("copy $fullname $backup");
		$tmpfile1 = "$fullname".".tp1";
		$tmpfile2 = "$fullname".".tp2";
		$startend = ( $first - 1 ) * 100000;
		system("HCopy -A -e $startend $fullname $tmpfile1");
		$endstart = ( $last + 1 ) * 100000;
		system("HCopy -A -s $endstart $fullname $tmpfile2");
		system("HCopy -A $tmpfile1 + $tmpfile2 $fullname");
		unlink $tmpfile1;
		unlink $tmpfile2;
	}
}
close(CORRUPTFILE);   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -