Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to read audio file metadata failed with message: unknown format: 3 #222

Open
sebastianojones opened this issue Oct 10, 2023 · 3 comments

Comments

@sebastianojones
Copy link

Hello! This is an awesome tool for NFCs; unfortunately I'm running into some issues importing recordings into Vesper. I can't seem to get past this error when attempting to import .wav files that I recorded with Audacity prior to installing Vesper. This is probably a silly error on my part somewhere though I feel pretty confident I updated the various .yaml files appropriately (changing the station name aliases etc). I tried completely reinstalling everything to no avail. Pasting the log below, any suggestions would be welcome!

2023-10-10 20:25:12,856 INFO Job started for command "import" with arguments:
2023-10-10 20:25:12,858 INFO {
2023-10-10 20:25:12,859 INFO "importer": {
2023-10-10 20:25:12,859 INFO "name": "Recording Importer",
2023-10-10 20:25:12,859 INFO "arguments": {
2023-10-10 20:25:12,860 INFO "paths": [
2023-10-10 20:25:12,860 INFO "/Users/sebastian_jones/Desktop/SheridanStreet/Recordings"
2023-10-10 20:25:12,861 INFO ],
2023-10-10 20:25:12,862 INFO "recursive": false,
2023-10-10 20:25:12,863 INFO "recording_file_parser": {
2023-10-10 20:25:12,864 INFO "name": "MPG Ranch Recording File Parser",
2023-10-10 20:25:12,864 INFO "arguments": {
2023-10-10 20:25:12,867 INFO "station_name_aliases_preset": "Station Name Aliases"
2023-10-10 20:25:12,868 INFO }
2023-10-10 20:25:12,868 INFO }
2023-10-10 20:25:12,870 INFO }
2023-10-10 20:25:12,871 INFO }
2023-10-10 20:25:12,871 INFO }
2023-10-10 20:25:12,878 ERROR Recording import failed with an exception.
The exception message was:
Error parsing recording file "/Users/sebastian_jones/Desktop/SheridanStreet/Recordings/SSB_2023-09-30_23.18.00_Z.wav": Attempt to read audio file metadata failed with message: unknown format: 3
The archive was not modified.
See below for exception traceback.

@HaroldMills
Copy link
Owner

From the "unknown format: 3" part of the error message I think your file might contain floating point samples. Can you confirm that? The Python module that Vesper currently uses to read .wav files (the "wave" module of the Python Standard Library that comes with Python 3.9) unfortunately does not support floating point samples. It appears that such support may already be present in Python 3.12, and I will test that soon. Right now, though, if your files do contain floating point samples your best bet would be to create 16-bit integer versions of them, for example with SoX, and use those in your Vesper archive.

@sebastianojones
Copy link
Author

Awesome! Thanks for the suggestion and really appreciate you taking the time to help out. I will try this out tonight when I’m back home and let you know how it goes. Hopefully this is the issue as it sounds like an easy fix (I will also check to see what the default export settings are in Audacity and adjust those). For what it’s worth I ran the same files through Nighthawk via the terminal without any issues though it looks like that uses Python 3.10…

@HaroldMills
Copy link
Owner

Nighthawk uses the third-party soundfile package to read audio files rather than the Python Standard Library's wave module. soundfile can read floating point .wav files as well as sound files of many other formats. I'll be considering using that package in Vesper as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants