beets
beets copied to clipboard
WAV Support
Please allow WAV-files to be imported
Hi! As with #1160, do you have any references for how metadata tags might be saved in .wav files? Is there a standard way, or even a de facto common practice?
You might also be interested in reading #250, the thread about AIFF support (which we now have).
It seems that the WAV-format may contain metadata-blocks of different types: http://wavmetadata.blogspot.com https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
I do not know of if there is a de facto common practice. But it would be nice to be able to import wav-files. Currently I haven't been able to do so. It may of course be that I haven't found the correct way to import wav files into my beets library.
You're right; it's currently not possible.
The problem, as you've no doubt surmised, is that we don't know exactly how to write tags to WAV files. Mutagen doesn't support it, so this is unlikely to happen immediately.
I know this isn't much of a solution, but have you considered switching to a more widely used lossless format, such as FLAC or ALAC?
Yes, I could convert the wav to flac. In that case, it would be nice to use the convert plugin during import. I do not think it is run during import now, or have i configured it wrong?
Hmm, interesting—no, convert-on-import won't quite work here, because beets needs to be able to read the metadata even for files that it's just converting. So, at least for the moment, you'd need to use some other tool to do the conversion. Interesting idea, though!
What if instead of trying to insert metadata tags into wav files, which sort of isn't recommended since it messes with the container structure, one still had the ability to rename wav files based on user configuration?
Yes, that's another option—supporting some file types that can't store metadata at all. It's worth considering, but we haven't done that for any other formats yet, so it would require a few architectural (and documentation) changes.
This may create even more problems, but what about converting the WAV to FLAC, leaving the WAVs where they are (or wherever the user wants them), and importing the FLAC files to the normal sorted library location for beets?
Right—in fact, that could be accomplished already with the convert
plugin if beets was allowed to scan WAV files.
I would be quite happy with an "import wav, convert to FLAC, write metadata" approach. Would this be a lower friction route than full support for non-metadata storing formats?
It probably would; yes! But either would be a worthy project.
@sampsyo -- if someone were interested in working on this functionality, do you have design guidance or pointers for where to start looking?
@khimaros Good question! I can think of two good places to start:
- Take a look at the existing
filefilter
plugin. That intercepts "import tasks" (as they're called) from the importer pipeline and drops them if they don't match a pattern. A hypothetical new plugin could work much the same way—it gets newImportTask
objects, checks whether they contain WAV files, and transcodes them to FLAC, and then continues. We'd also need to add some new API to tell the importer that it's OK to load WAV files without reading their metadata. - Look at the code in
importer.py
for handing compressed archives (e.g., zip files). Theunarchive
method inImportTaskFactory
is the central piece there. We could build in a similar check for files that need transcoding.
And then there's also the alternative of just supporting files without embedded metadata. The places to look for that are read_item
in importer.py
and the from_path
method on Item
in library.py
. The current logic tries opening the file with MediaFile
and, if that fails, says that the Item
object could not be created. We could instead use a list of known metadata-free audio format extensions to allow some files that can't be read.
Perhaps this could ne helpful : http://bwfmetaedit.sourceforge.net/ This is how metadata are stored in wave BWF format ( Brodcast Wave )
Tagging is still possible with audio fingerprinting via the chroma plugin.
As someone looking to use Beets for managing a sound FX library, I don't often have control over filetypes; I'd love to be able to import WAVs, even if I have to manually tag them.
Just wanted to point out that there has been some activity on WAV support in Mutagen lately in https://github.com/quodlibet/mutagen/pull/408. If you're interested in making this work, perhaps you can help out there. :smiley:
Now that https://github.com/quodlibet/mutagen/pull/408 has been merged, does that make supporting WAV less complicated?
Cool! It sure does. Happy to take a PR to depend on the new version of Mutagen and enable ID3 for WAV files.
@sampsyo Can probably close this issue since https://github.com/beetbox/mediafile/pull/50 should have resolved it.