I use a c-language program to create music as .wav files, then use Audacity to tweak levels, convert to stereo, add reverb and export to .mp3. I put metadata into my .wav files and I would like the same to be added to the final .mp3 files, but Audacity will not import the album title which I provide. All other fields (except track number, which I don’t need) are properly imported. I understand that metadata is not really native to .wav files, but since Audacity does import most of it, I don’t understand why it cannot import the other item I need. Can somebody explain this?
Please read the pink panel at the top of this page and have a look at http://wiki.audacityteam.org/wiki/WAV#Metadata. I would guess you are using an obsolete version of Audacity.
Thank you for your prompt reply. I’m sorry I forgot to include the information that I am using version 2.0.6 of Audacity and I installed it with the package manager of PCLinuxOS. I did not download and install the source code.
I had already read the Wiki item you suggested and searched (as best I could) through the forums for other posts relating to my question. I have no need to export to .wav format, although I experimented and found that Audacity does place a LIST/INFO chunk at the end of the .wav file which it creates, after the data chunk. Nonetheless, in order to get Audacity to read my own metadata, I had to put my LIST/INFO chunk within the RIFF header, before the data chunk. That was easy, and after doing it, I found that Audacity does import my metadata, except for the item corresponding to the IPRD identifier. That is the essence of my question. Why does Audacity import the others, but not that one? Would it not be relatively easy for a developer to “fix” that?
Thanks again for you help.
Audacity added support for both export and import of IPRD at the same time.
The exported ID3 and LIST INFO tags are placed at the end of the file. Audacity 2.0.7-alpha on Ubuntu 13.10 sees the IPRD tag in a file exported by Audacity, as should 2.0.6.
If it doesn’t do so for you, then perhaps Audacity was packaged by PCLinuxOS with an outdated version of libsndfile - we can’t control that if so. What version is your system libsndfile?
If you still cannot import the correct tags, please upload an example file that demonstrates the issue.
Thanks for your reply. Sorry to be slow in responding.
To answer your question, the installed version of libsndfile on my PC is 1.0.25.
After my previous post I remembered that I had seen a reference to libsndfile in the metadata which Audacity had appended to a file which I had exported as .wav. Although I don’t use libsndfile, I looked it up, installed the devel packages (as provided by my package manager) and wrote a little program to test it. The results were that neither IPRD nor ITRK were imported. So I concluded that the problem was not with Audacity but libsndfile. Audacity did not import them because libsndfile did not do so, although if I entered IPRD strings manually in Audacity, they were properly exported–not in the LIST/INFO chunk but in the id3 chunk.
Then as I was exploring around the web, I came across a longish post in SourceForge about this problem, and others related to it, apparently by devs at Audacity. Clearly my problem was well-known and being worked on. Apparently the solution for IPRD and ITRK was simple, so I decided to just wait until the fix was applied.
That’s why the present post is late. I got wound up in other matters. Sorry.
If 1.0.25 is an adequate version of libsndfile, then I really don’t understand what is going on.
Thanks for your attention.
How did you test that? libsndfile-info 1.0.25 on Windows sees IPRD at the end of the file (it doesn’t understand ID3, of course).
That’s not correct - Album Title should be exported as both IPRD for LIST INFO and TALB for ID3. I can confirm that the exported IPRD tag is corrupted using Audacity 2.0.7-alpha on Ubuntu 13.10 (using libsndfile 1.0.25). libsndfile-info doesn’t then see that tag, but Audacity will still see the tag in Metadata Editor because it reads the ID3 tag too.
Also, Audacity should see imported LIST INFO tags (including IPRD) without you having to put the LIST INFO chunk before the data chunk.
Export and import of IPRD works correctly on Windows using Audacity 2.0.7-alpha built with libsndfile 1.0.24. I’ll build Audacity on Ubuntu with the local libsndfile it ships with (1.0.24) and then compare it if built with system libsndfile (which is 1.0.25 for me too). Obviously you can do the same if you want.
Alternatively here is a WAV with a single IPRD tag in a LIST INFO chunk at the end of the file (there is no ID3 tag). Audacity 2.0.7-alpha (libsndfile 1.0.24) sees that tag on Windows. See what happens for you on Linux.
As another solution, your packaged version of Audacity may be built with FFmpeg support (look in Audacity’s Libraries Preferences, or if there is no Libraries Preferences then Audacity was built with FFmpeg). If you have FFmpeg support, open Audacity’s “Extended Import” Preferences, create a rule for *.wav, then drag “FFmpeg-compatible files” to the top and uncheck the “Attempt to use…” box. Then FFmpeg will import the WAV instead of libsndfile. My Audacity on Ubuntu is built with FFmpeg 2.2.3 and Audacity sees the IPRD tag in the attached file.
Here are some more results.
First off, you asked how I tested libsndfile. I wrote a tiny c program and linked in libsndfile, opened one of my .wav files with it, and printed out the values of all of the INFO tags. All were present except IPRD and ITRK.
I tried to attach a copy of the source file but it was not allowed.
You said that the LIST/INFO chunk should not need to be before the data chunk, but when I switch it past the data chunk, Audacity does not find it.
When I open the file you sent in either Audacity or directly in libsndfile, the IPRD tag is not detected. Using a hex editor I verified that the LIST/INFO chunk is present.
After all that, I followed your instructions to make Audacity use FFmpeg for importing. Now I find that both IPRD and ITRK are seen but not IART nor ICRD. That seems totally crazy to me. Of course Audacity now sees the IPRD tag in the file you sent.
It suddenly occurs to me that the fact that I use 32-bit float values as sample data may have some effect. Do you think that is possible?
Another possibility is that the devs at PCLinuxOS who create the packages for the repo are fouling something up. In the past I have sometimes thought that was true, but it has always turned out to be an error on my part.
So I’m stumped. If you are tired of this runaround, I won’t blame you for stopping it.
If you would like to attach a file, please see https://forum.audacityteam.org/t/how-to-attach-files-to-forum-posts/24026/1
I’ve now built Audacity 2.0.7-alpha on Ubuntu 13.10 with the local libsndfile 1.0.24 it ships with. I can confirm that import and export of all seven standard LIST INFO tags (the fields listed in Audacity’s Metadata Editor) is perfect. The LIST INFO tags are exported at the end of the file and read at the end of the file. With 2.0.7-alpha built with system libsndfile 1.0.25, IPRD and ITRK are not imported and not exported, as you say.
So if you want to use Audacity I would again suggest you compile Audacity from source with local libsndfile 1.0.24:
and place your tags at the end of the file. See Redirecting to: https://www.audacityteam.org/download for source code downloads.
Alternatively, use the Windows version of Audacity (under WINE if you want to use Linux).
The sndfile-info program that ships with libsndfile 1.0.24, 1.0.25 and a pre-release of 1.0.26 sees all seven LIST INFO tags but reports an ITRK value of “1” as “2”. That would suggest (part of) the bug is in Audacity when using 1.0.25, but you say your program which links in libsndfile (presumably 1.0.25) behaves the same as Audacity. If you repeated that test with libsndfile 1.0.24 and got all the tags, that might suggest there is something wrong with how libsdnfile 1.0.25 is interfacing with programs. Please let me know if you do that test with 1.0.24.
Yes I can confirm that on Ubuntu and Windows but I did not know that was the case. Given ffprobe sees all seven standard tags, I assume it’s an Audacity bug.
I was using 16-bit PCM, but I think it unlikely 32-bit float would affect the results. Let me know if you find otherwise.
I’m happy to report that the problem is, or seems to be, solved. I played around with the Extended Import options of Audacity. They are now set exactly as you suggested for *.wav, except that the filter “WAVE, AIFF, and other uncompressed types” is at the top, before “FFmpeg-compatible files.” Now all of the tags I use are imported correctly. Does that make sense to you?
I experimented quite a bit with libsndfile and never got all tags to be imported. Found a little error in the documentation, but no matter, nothing I did seemed to help. Some items would be imported if they were early in the INFO chunk, and not otherwise. Crazy. In fact, a lot of the documentation for that software seemed to me to be a bit flaky, but of course I’m no judge.
Thanks again for all your help. I’m extremely impressed by the way you worked on my problem.
Can this thread be marked Solved? Should I do it, or only you? If I should, please tell me how.
That makes no sense to me unless you compiled Audacity with libsndfile 1.0.24. What you did will force WAV to import with libsndfile, but that happens anyway by default.
It could, but I see no clear explanation of what fixed it for you if your Audacity is still compiled with libsndfile1.0.25.
Perhaps it depends where the LIST INFO chunk is in the file where you got it to work. Can you attach or upload a file where Audacity built with libsndfile 1.0.25 (presumably your packaged build of Audacity) reads all the LIST INFO tags? You can attach a file up to 1 MB in size. See https://forum.audacityteam.org/t/how-to-attach-files-to-forum-posts/24026/1
You are right, of course. I did not find a solution. It seems I was importing a file twice, once with one input filter and again, after removing that track, with another filter. I did not realize that Audacity was saving the first metadata it received even after deleting the track. So the second time I imported the file, the previous metadata was still present. Then I found out that when the FFmpeg filter is used, it overwrites the previous metadata and blanks out the items it doesn’t understand. On the other hand, the WAV, AIFF, etc. filter overwrites items it understands but leaves the ones it doesn’t understand unchanged.
So apparently what happened is that I imported the file first with the FFmpeg filter, then after removing the track, again with the WAV, AIFF, etc. filter. Wonderful! All my metadata is present! That is (I think) how I came to believe that the problem was solved.
I am reluctant to install Audacity from source because I’m afraid it might confuse the package manager. I have only one PC and it is used for several jobs. It would be a minor disaster if it became unusable. If it is agreeable to you, let me have a couple of days to work through this matter. If I can’t get anywhere, I’ll let you know. But for now, your advice to install from source is the most likely solution, although it is one I am afraid to use.
I really appreciate your help on a topic of such little real importance, at least for the vast majority of users.
I think that misunderstanding comes about because you don’t appreciate that Audacity doesn’t open a file. It imports a file into a project. If you had done CTRL + W to close the project window, rather than removing the track, then the project’s metadata would have been cleared.
Audacity can only store one set of metadata at a time, so if you import another file, the metadata contents is overwritten with the metadata of the last imported file. So if you imported using FFmpeg then using libsndfile, you should indeed be missing IPRD and ITRK.
But I think you actually “Set Default” in Metadata Editor for those tags that FFmpeg imported. Then when you imported using libsndfile, the empty IPRD and ITRK were populated from your specified default.
There is no risk. To avoid complications, just uninstall the packaged version of Audacity, configure Audacity --with-libsndfile=“local”, then install your self-compiled build.
Alternatively, don’t install your self-compiled build. Execute audacity from the “src” folder inside the build folder, either by double-clicking it from your file manager, or navigate to the “src” folder inside the build folder then
Yes, I was not using Audacity correctly, but only importing a file, checking and maybe modifying various things, then perhaps exporting it, but never saving the project. Thanks for straightening me up. Now I import a file for the first time, thereby creating a project, using the FFmpeg input filter. After removing the track, I import the same file again using the .WAV, AIFF filter, which does not blank out metadata items which it does not understand (as does FFmpeg) but rather leaves them as they are. Then Audacity has all the metadata of the file, so I can save the project and never lose it. Even if I have to import the same file again, as long as I use the .WAV, AIFF filter, I will not lose the tags which only FFmpeg could see.
This works regardless of whether the checkbox in Audacity’s Extended import dialog is checked or unchecked, or whether the LIST chunk is before or after the data chunk. The only critical point is importing the file twice, first with FFmpeg and then with .WAV, AIFF and never using the FFmpeg filter again.
As for compiling and installing Audacity from source, I’m still considering it. But in the mean time I have been playing around with libsndfile. There is one little thing which reminds me of what can happen if hexadecimal and decimal values are confused in an assembly language program. It’s hard to imagine that libsndfile is written in assembly language but maybe 20 years ago I saw how that sort of confusion in an assembly language program can manifest itself just as some quirk I see in libsndfile 1.0.25. That is probably of no interest for Audacity devs, but I could upload a little program file which shows what I mean if you like.
Thanks again for helping me to use Audacity better.
As I said, Audacity supplied by us and built with libsndfile 1.0.25 would be missing IPRD and ITRK after the libsndfile import, unless you used “Set Default” in Metadata Editor after the FFmpeg import.
Libsndfile is written in C with a C++ wrapper.
As I said, sndfile-info sees all the LIST INFO tags, though appears to misinterpret ITRK.
Given your program and Audacity both fail to see IPRD and ITRK in libsndfile 1.0.25, it could be that the issue is with libsndfile and not Audacity.
As I suggested, it may be useful to try your program with libsndfile 1.0.24. You could then report a bug to libsndfile. However they will require the sndfile-info output.
Thanks for your patience, Gale. I’m sorry but I’m giving up. I can do all that I need to do with Audacity by means of that workaround I described. The more I investigate libsndfile 1.0.25, the more discrepancies I find. One of their error messages which I received had to do with their software being misconfigured (sizeof something) before being compiled. That’s an error message for devs, not users. Personally I’m convinced that one of their errors is what I saw about ‘10’ being interpreted as hexadecimal instead of decimal. Once I tried to join their forum or something but my request was rejected. I don’t know why, but maybe it was because I live in Venezuela. Anyway, I am more sure than ever that the problem I was seeing for my own work is with libsndfile (and maybe FFmpeg) rather than Audacity.
Since I need to get on with my own projects, I do not really want to pursue errors in libsndfile any further. I hope you will understand. I truly appreciate all you have done for me.