agfline / wavfix Goto Github PK
View Code? Open in Web Editor NEWRepair broken wav files while preserving metadata.
License: GNU Affero General Public License v3.0
Repair broken wav files while preserving metadata.
License: GNU Affero General Public License v3.0
There is no file extension for your downloads. I would like to use your program but I have no idea how to make use of the binary. Compiling the source proves to be even more frustrating for a non-programming savvy person. Do I have to give the binary an extension or what exactly do I do with it??
Hi,
I just had a problem with a .wav file when I was "backuping" a sd card on my laptop.
The usb connector of the sd card reader just disconnect during the copy, and after that, I was able to recover all my files, but one of them was corrupted. Probably the one that was copying when the cable disconnected.
As a result, that wav file comes with an added group of continuous frequencies, like a complex hum upon 1kHz that affect also voices.
Do you think your app can resolve that issue?
Thanks by advance for your response
All the best,
Manuel
(I don't know anything about "coding" and when I download your "mac" version, I don't know how to use it.)
Hello. Thank you very much for your tool. If you're looking for some challenge, that may be interesting feature to implement.
Sometimes it happens that some files have corrupted headers, but can be played by only limited amount of players (usually MPC-HC and/or VLC Media Player) but not DAWs. I encountered such situation while trying to rip e.g. Call of Duty Black Ops music from game files. There might be more usage scenarios of the tool, not only when recorder suddenly stops and a file becomes corrupted.
Here is a sample:
https://yadi.sk/d/olYaOUQZFgmz8A
I had also some VOX ADPCM variant files which couldn't be decode by RAW import option by Audacity neither.
I know that I can convert the file with VLC or probably SOX, but editing just header would be something different.
Regards
Hello, I'm getting some errors when I run make. Do you have any insight? Thank you.
gcc ./src/*.c -o wavfix -W -Wall
In file included from ./src/libwav.c:29:0:
./src/libbext.h:113:16: warning: inline function ‘bext_codh_mode_to_chan’ declared but never defined
inline uint8_t bext_codh_mode_to_chan( uint8_t mode );
^~~~~~~~~~~~~~~~~~~~~~
In file included from ./src/wavfix.c:36:0:
./src/libbext.h:113:16: warning: inline function ‘bext_codh_mode_to_chan’ declared but never defined
inline uint8_t bext_codh_mode_to_chan( uint8_t mode );
^~~~~~~~~~~~~~~~~~~~~~
/tmp/ccNnhSo9.o: In function `rebuild_fmt_chunk':
wavfix.c:(.text+0xb4): undefined reference to `_print_verb'
wavfix.c:(.text+0xcb): undefined reference to `_print_verb'
wavfix.c:(.text+0xe2): undefined reference to `_print_verb'
wavfix.c:(.text+0x132): undefined reference to `_print_verb'
wavfix.c:(.text+0x149): undefined reference to `_print_verb'
/tmp/ccNnhSo9.o:wavfix.c:(.text+0x160): more undefined references to `_print_verb' follow
/tmp/ccNnhSo9.o: In function `rebuild_fmt_chunk':
wavfix.c:(.text+0x44d): undefined reference to `bext_codh_mode_to_chan'
wavfix.c:(.text+0x46b): undefined reference to `bext_codh_mode_to_chan'
wavfix.c:(.text+0x484): undefined reference to `_print_verb'
wavfix.c:(.text+0x4a6): undefined reference to `_print_verb'
wavfix.c:(.text+0x4ce): undefined reference to `_print_verb'
wavfix.c:(.text+0x4e3): undefined reference to `bext_codh_mode_to_chan'
wavfix.c:(.text+0x502): undefined reference to `bext_codh_mode_to_chan'
wavfix.c:(.text+0x5e4): undefined reference to `_print_verb'
wavfix.c:(.text+0x70c): undefined reference to `_print_verb'
wavfix.c:(.text+0x722): undefined reference to `_print_verb'
wavfix.c:(.text+0x76b): undefined reference to `_print_verb'
wavfix.c:(.text+0x781): undefined reference to `_print_verb'
/tmp/ccNnhSo9.o:wavfix.c:(.text+0x7c7): more undefined references to `_print_verb' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: all] Error 1
Hello.
I am trying to use wavfix on my mac (2017 intel mbp), but seems that it cannot be used in terminal.
SInce the file in
https://github.com/agfline/wavfix/releases
is not recognised as Unix command but just unknown type of file.
I tried to copy it using cp on Terminal to bin directory but it did not worked. nor method stated in;
#10
even I have tried both zsh and bash shell, but sadly, did not work...
even make / make install command failed with some errrors.
What can I do next?
p.s. I am still newbie struggling with linux commands.
i dont see a exe or zip file ????
Hello @agfline, was wondering if you can help me with installing wavfix on my laptop. i'm kindoff a newbie when it comes to this but i really need help fixing some wav files i have
When running the program, wavfix only fixes a percentage of the file. For example, a 55 minute wav file (951.1 MB) only fixes 2:29 of it (also 951.1 MB) with the rest still lost.
Thank you for your work!
Do you have any ideas to solve that problem?
Thank you very much!
first of all thanks for the great idea of this tool! :)
the following is a very common scenario of wav file corruption wich is not covered by wavfix:
the issue is, in case the chunk size is zero (wich often occours when the recording device looses power) as i understood, wavfix tests all the data behind the data chunk and finds weired "chunks" by checking if its a "valid" riff-chunk:
https://github.com/agfline/wavfix/blob/master/src/libriff.c#L218-L250
assuming 4 bytes in a row define a new chunk.
in case of sound-devices recorder i mostly use, in my experience there is mostly only some chunk after the chunk . but the main part of the "rest"file size is valid sample data still intact.
when i try sox
sox --ignore-length XXX.WAV
the output would be perfect wave file with all data but all metadata and heades are lost. thats where wavfix should come in ;)
i assume that so far wavfix can only repair wav-files that do not come up with 4 chars in the sample data, whereas in longer files the likelyhood is very big.
see my wavfix example output of broken 900MB wav file:
Processing 'XXX.WAV'
| [w] Wrong RIFF size: 0000000000 B + 8 [file size: 0210763776 B;]
| Current file structure :
| ======================
| bext chunk [offset: 0000000012; size: 0000000858 + 4 + 4;]
| iXML chunk [offset: 0000000878; size: 0000005226 + 4 + 4;]
| fmt chunk [offset: 0000006112; size: 0000000016 + 4 + 4;]
| data chunk [offset: 0000006136; size: 0000000000 + 4 + 4;]
| [NULL] chunk [offset: 0000006144; size: 0003831957 + 0 + 0;] odd w/ pad
| bvDD chunk [offset: 0003838109; size: 0167829378 + 4 + 4;]
| [NULL] chunk [offset: 0171667495; size: 0039096289 + 0 + 0;] odd w/ pad
|
| [i] Checking data chunk..
| | Chunk size is 0 byte. That is very unlikely..
| | A block of 3831957 unknown bytes comes after data chunk.
| | Assume those are audio data. Merging them with data chunk..
| | done.
|
| Recovered file structure :
| ========================
| bext chunk [offset: 0000000012; size: 0000000858 + 4 + 4;]
| iXML chunk [offset: 0000000878; size: 0000005226 + 4 + 4;]
| fmt chunk [offset: 0000006112; size: 0000000016 + 4 + 4;]
| data chunk [offset: 0000006136; size: 0003831957 + 4 + 4;] odd w/ pad
| bvDD chunk [offset: 0003838101; size: 0167829378 + 4 + 4;]
| [NULL] chunk [offset: 0171667487; size: 0039096289 + 0 + 0;] odd w/ pad
| [w] 1 unknwon bytes block remains.
| Some programs like Pro Tools use wrong formated files
| like this ( DIGI chunk size missing 1 byte in PT ),
| so we wont correct it. Yet it should play fine anyway.
|
| [i] Saving repaired file to 'XXX_REPAIRED.WAV'
ADDING PADDING BYTE
ADDING PADDING BYTE
| File successfully recovered.
wavefix doesn't accept its own generated _REPAIR + its not a valid wav file.
in this case the pattern 'AbvD' in the sample data causes wavfix to think the data chunk is over.
Processing 'XXX_REPAIRED.WAV'
| [w] Wrong RIFF size: 0000000002 B + 8 [file size: 0210763786 B;]
| Current file structure :
| ======================
| bext chunk [offset: 0000000012; size: 0000000858 + 4 + 4;]
| iXML chunk [offset: 0000000878; size: 0000005226 + 4 + 4;]
| fmt chunk [offset: 0000006112; size: 0000000016 + 4 + 4;]
| data chunk [offset: 0000006136; size: 0003831957 + 4 + 4;] odd w/ pad
| AbvD chunk [offset: 0003838101; size: 0014647876 + 4 + 4;]
| [NULL] chunk [offset: 0018485985; size: 0095141419 + 0 + 0;] odd w/ pad
| MZ5g chunk [offset: 0113627412; size: 0041223827 + 4 + 4;] odd w/ pad
| [NULL] chunk [offset: 0154851247; size: 0016816249 + 0 + 0;] odd w/ pad
| [NULL] chunk [offset: 0171667504; size: 0039096289 + 0 + 0;] odd w/ pad
| [NULL] chunk [offset: 0210763801; size: 0000000001 + 0 + 0;] odd w/ pad
|
| [i] Checking data chunk.. failed.
thats what the output is after i manually repaired the file with a hex editor:
Specification of the Broadcast Wave Format (BWF) helped me.
Processing XXX_MANUALLY_REPAIR.WAV'
| Current file structure :
| ======================
| bext chunk [offset: 0000000012; size: 0000000858 + 4 + 4;]
| iXML chunk [offset: 0000000878; size: 0000005226 + 4 + 4;]
| fmt chunk [offset: 0000006112; size: 0000000016 + 4 + 4;]
| data chunk [offset: 0000006136; size: 0210757626 + 4 + 4;]
|
| [i] Checking data chunk.. ok.
|
| File ok.
i hope this problem is fixable. it would "fix" so many more broken wav files out there and make many people happy :)
even though i'm not a C programmer, i'm willing to help if i can.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.