oga's tools
Révision | 0da93104107009b029c71f744b472de51d1bcf6a (tree) |
---|---|
l'heure | 2021-05-09 06:29:12 |
Auteur | hyperoga <hyperoga@gmai...> |
Commiter | hyperoga |
21/05/08 V0.32 support 64bit Linux
@@ -15,6 +15,7 @@ | ||
15 | 15 | * 12/03/19 V0.29 fix -ex degrade (調査中 ex. -ex 00:05-21:50) |
16 | 16 | * 21/05/02 V0.30 support -cs cut silent part |
17 | 17 | * 21/05/03 V0.31 fix LIST chunk bug |
18 | + * 21/05/08 V0.32 support 64bit Linux | |
18 | 19 | * |
19 | 20 | * |
20 | 21 | * お勧め: wavcut -s -lv 20 -ln 15 |
@@ -50,7 +51,7 @@ | ||
50 | 51 | #define strncasecmp strnicmp |
51 | 52 | #endif /* _WIN32 */ |
52 | 53 | |
53 | -#define VER "0.31" | |
54 | +#define VER "0.32" | |
54 | 55 | #define dprintf if (vf) printf |
55 | 56 | #define dprintf2 if (vf >= 2) printf |
56 | 57 | #define sgn(x) (x==0)?0:((x>0)?1:-1) |
@@ -71,7 +72,8 @@ int mf = 0; /* -m merge wavfiles V0.27-A */ | ||
71 | 72 | int csf = 0; /* -cs cut silent part V0.30-A */ |
72 | 73 | int peak_level = 0; /* peak level for -no */ |
73 | 74 | int max_level = 0; /* max level for -no */ |
74 | -long pre_datlen = 0; /* heders total length to wav data */ | |
75 | +/* long pre_datlen = 0; heders total length to wav data */ | |
76 | +int pre_datlen = 0; /* heders total length to wav data V0.32-C */ | |
75 | 77 | |
76 | 78 | int gBytePerSample = 0; /* Byte / Sample */ |
77 | 79 | int gChannels = 0; /* Num of Channel */ |
@@ -81,13 +83,13 @@ int gUnit = 0; /* Byte / Sample * nChannel */ | ||
81 | 83 | /* data formats */ |
82 | 84 | struct riff_hdr { |
83 | 85 | char id[4]; /* RIFF id ("RIFF") */ |
84 | - unsigned long len; /* length */ | |
86 | + unsigned int len; /* length V0.32-C */ | |
85 | 87 | char wave_id[4]; /* data type ("WAVE") */ |
86 | 88 | }; |
87 | 89 | |
88 | 90 | struct chunk_hdr { |
89 | 91 | char id[4]; /* chunk id ("fmt "|"data"...) */ |
90 | - unsigned long len; /* chunk length */ | |
92 | + unsigned int len; /* chunk length V0.32-C */ | |
91 | 93 | }; |
92 | 94 | |
93 | 95 | /* chunk type fmt 1 */ |
@@ -105,8 +107,8 @@ struct ck_fmt { | ||
105 | 107 | #define IBM_FORMAT_ALAW 0x0102 /* IBM a-law format */ |
106 | 108 | #define IBM_FORMAT_ADPCM 0x0103 /* IBM AVC Adaptive Diff PCM format */ |
107 | 109 | unsigned short wChannels; /* Number of channels */ |
108 | - unsigned long dwSamplesPerSec; /* Sampling rate */ | |
109 | - unsigned long dwAvgBytesPerSec; /* For buffer estimation */ | |
110 | + unsigned int dwSamplesPerSec; /* Sampling rate V0.32-C */ | |
111 | + unsigned int dwAvgBytesPerSec; /* For buffer estimation V0.32-C */ | |
110 | 112 | unsigned short wBlockAlign; /* Data block size */ |
111 | 113 | unsigned short wBitsPerSample; /* Sample size (for WAVE_FORMAT_PCM */ |
112 | 114 | unsigned short unknown; /* Unknown data */ |
@@ -451,7 +453,7 @@ int WavAnalyze(FILE *fp) | ||
451 | 453 | if (sf || csf || (ntment && outf)) { /* V0.30-A */ |
452 | 454 | /* ### Open Output File */ |
453 | 455 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
454 | - printf("## Writing %s ...\n", fname); | |
456 | + printf("## Writing1 %s ...\n", fname); | |
455 | 457 | wfp = fopen(fname, "wb"); |
456 | 458 | if (wfp == NULL) { |
457 | 459 | perror(fname); |
@@ -567,7 +569,7 @@ int WavAnalyze(FILE *fp) | ||
567 | 569 | } |
568 | 570 | if (sf) { |
569 | 571 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
570 | - printf("## Writing %s ...\n", fname); | |
572 | + printf("## Writing2 %s ...\n", fname); | |
571 | 573 | /* ### Open Next Wav File */ |
572 | 574 | wfp = fopen(fname, "wb"); |
573 | 575 | if (wfp == NULL) { |
@@ -622,7 +624,7 @@ int WavAnalyze(FILE *fp) | ||
622 | 624 | if (wfp == NULL) { |
623 | 625 | data_size = 0; /* reset data chunk size */ |
624 | 626 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
625 | - printf("## Writing %s ...\n", fname); | |
627 | + printf("## Writing3 %s ...\n", fname); | |
626 | 628 | /* ### Open Wav File */ |
627 | 629 | wfp = fopen(fname, "wb"); |
628 | 630 | if (wfp == NULL) { |
@@ -1015,7 +1017,7 @@ void MergeWavs(char **files) | ||
1015 | 1017 | if (sf || (ntment && outf)) { |
1016 | 1018 | /* ### Open Output File */ |
1017 | 1019 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
1018 | - printf("## Writing %s ...\n", fname); | |
1020 | + printf("## Writing4 %s ...\n", fname); | |
1019 | 1021 | wfp = fopen(fname, "wb"); |
1020 | 1022 | if (wfp == NULL) { |
1021 | 1023 | perror(fname); |
@@ -1125,7 +1127,7 @@ void MergeWavs(char **files) | ||
1125 | 1127 | data_size = 0; /* reset data chunk size */ |
1126 | 1128 | if (sf) { |
1127 | 1129 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
1128 | - printf("## Writing %s ...\n", fname); | |
1130 | + printf("## Writing5 %s ...\n", fname); | |
1129 | 1131 | /* ### Open Next Wav File */ |
1130 | 1132 | wfp = fopen(fname, "wb"); |
1131 | 1133 | if (wfp == NULL) { |
@@ -1180,7 +1182,7 @@ void MergeWavs(char **files) | ||
1180 | 1182 | if (wfp == NULL) { |
1181 | 1183 | data_size = 0; /* reset data chunk size */ |
1182 | 1184 | sprintf(fname, "%s_%03d.wav", in_fname, file_cnt++); |
1183 | - printf("## Writing %s ...\n", fname); | |
1185 | + printf("## Writing6 %s ...\n", fname); | |
1184 | 1186 | /* ### Open Wav File */ |
1185 | 1187 | wfp = fopen(fname, "wb"); |
1186 | 1188 | if (wfp == NULL) { |
@@ -1411,7 +1413,7 @@ int main(int a, char *b[]) | ||
1411 | 1413 | ++vf; |
1412 | 1414 | continue; |
1413 | 1415 | } |
1414 | - if (!strncmp(b[i],"-d",2)) { | |
1416 | + if (!strcmp(b[i],"-d")) { | |
1415 | 1417 | df = 1; /* Display Wav Data */ |
1416 | 1418 | continue; |
1417 | 1419 | } |
@@ -1419,7 +1421,7 @@ int main(int a, char *b[]) | ||
1419 | 1421 | rvf = 1; /* Reduce Voice */ |
1420 | 1422 | continue; |
1421 | 1423 | } |
1422 | - if (!strncmp(b[i],"-s",2)) { | |
1424 | + if (!strcmp(b[i],"-s")) { | |
1423 | 1425 | if (ntment || csf) { /* V0.30-C */ |
1424 | 1426 | usage(); |
1425 | 1427 | } |
@@ -1428,7 +1430,7 @@ int main(int a, char *b[]) | ||
1428 | 1430 | } |
1429 | 1431 | |
1430 | 1432 | /* V0.30-A start */ |
1431 | - if (!strncmp(b[i],"-cs",2)) { | |
1433 | + if (!strcmp(b[i],"-cs")) { | |
1432 | 1434 | if (ntment || sf) { |
1433 | 1435 | usage(); |
1434 | 1436 | } |