?
Solved

remove unneeded file headers

Posted on 2009-12-29
7
Medium Priority
?
345 Views
Last Modified: 2013-11-13
Hi,

I have a collection of files, ASCII files (well, MS Wave audio files). They all have a LAME header, but the files are VBR so I can't play them. The LAME header is followed by a standard WAVE file header "RIFF Wavefmt". Many years ago a friend of mine wrote a tool to separate files based on a string delimiter, and I can use it for one file at a time to copy everything that comes after "RIFF" (including "RIFF" string) and paste it in a new file. This way the new file starts from RIFF and ends like the file that started with LAME, so in effect the LAME header was removed and the new file plays no problem. My problem is that I have 830 files, and the tool I have it's a simple GUI one by one file, and it will take me forever to do this one file at a time.

So I'm asking for your help. I need a quick script/CLI program that does the same thing as the tool above, but against a collection of files  

Thanks!
0
Comment
Question by:sblanken
  • 4
  • 3
7 Comments
 
LVL 13

Expert Comment

by:zadeveloper
ID: 26143910
Here is a little app to do that.
This app will create new files in a folder called converted and will not delete any of the original files.
I have included all the souce code for you as well (incase one day you want to modify it)

screenshot.jpg
RemoveLAMEHeaders.zip
0
 

Author Comment

by:sblanken
ID: 26147326
Hi,

your program works fine, and it finds the RIFF string and saves the files from there. But for some reason, when saving the files, the internal content of the file is not preserved, and it's converted to something that media player can't play. See attached for comparison.

Thanks!
wav.jpg
0
 
LVL 13

Expert Comment

by:zadeveloper
ID: 26148588
cool, will post a new version in about an hour

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Accepted Solution

by:
zadeveloper earned 2000 total points
ID: 26148833
New version writes binary files

RemoveLAMEHeaders.zip
0
 

Author Comment

by:sblanken
ID: 26148917
YAY!!! works perfect. And it fixed all my 830 files! YAY!!! Thank you!!!!
0
 

Author Closing Comment

by:sblanken
ID: 31671100
YAY!!! all good!!! :)
0
 
LVL 13

Expert Comment

by:zadeveloper
ID: 26149178
Glad to help :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question