Repository navigation
several WavPack import/export fixes - #3330
Conversation
…oat files with non-standard normalization (Cooledit/Audition)
…e unreachable code path
…to "bps" (bits/sample)
| n.mb_str(wxConvUTF8), | ||
| v.mb_str(wxConvUTF8), | ||
| static_cast<int>( v.length() )); | ||
| static_cast<int>( strlen(v.mb_str(wxConvUTF8)) )); |
| wxLogDebug("WavpackOpenFileInput() failed on file %s, error = %s", filename, errMessage); | ||
| return nullptr; |
There was a problem hiding this comment.
Probably wxLogError is a better idea. wxLogDebug does not generate any user visible output really.
There was a problem hiding this comment.
I didn't really intend this for the user, especially because this gets triggered any time the WavPack importer is invoked to check whether some random file is importable. However, it might be useful for debugging if libwavpack refuses to open a file that it should be able to.
| itemLen = WavpackGetTagItemIndexed(mWavPackContext, i, NULL, 0); | ||
| std::string item (itemLen + 1, '\0'); | ||
| WavpackGetTagItemIndexed(mWavPackContext, i, item.data(), itemLen + 1); | ||
| item.resize(itemLen); // remove terminating NULL from std::string |
There was a problem hiding this comment.
I'm not sure why do is this needed. This is safe here, though, so nothing critical
There was a problem hiding this comment.
I'm not a regular C++ programmer and just discovered that std::strings can include terminating NULLs. The issue this caused was that when the tag name had a NULL at the end it would no longer match the same string without a NULL. So, for example, this line did not work as intended:
Line 462 in 2c3c9d9
|
@crsib Thanks for the prompt review and merge! I'll continue testing, but I think this is pretty good at this point. |
|
@dbry thank you a lot for your help! |
Hi Audacity team!
First I would like to thank the Audacity team, and particularly @Subhra264, for integrating WavPack into Audacity. Great work!
Unfortunately at the time I was not aware that this was ongoing because I found out about it the day it was committed to master. I'm sure that if I'd been aware I could have helped it along and perhaps saved some headaches. But in any event, I have been testing it now for the past week or so and have discovered and and fixed some minor issues and put together these eight commits.
Probably the easiest way to review them is to look at the individual commits. Most of them were pretty trivial to find (like files from the official WavPack test suite that simply would not load), and while I'm happy to go into more detail, these should all be pretty self-explanatory. One issue, however, requires a little more explanation.
The hybrid mode of WavPack was configured with a bitrate from 16 - 384
kbps(kbits per second). The problem with this is that this fixed range does not take into account the sample rate and number of channels (which directly affect the bitrates available), and therefore presents sometimes inappropriate values. For example, with 24/96 stereo audio the minimum bitrate that the hybrid mode will work at is around 430 kbps, and 6-channel, 48-kHz audio will only go down to 650 kbps. So for these common audio formats the entire range of presented bitrates is too low, which essentially makes the feature useless.The solution I came up with is to present the bitrate in
bits per sampleinstead, ranging from 2.2 (the minimum the hybrid mode will operate) to 8.0 (the practical upper limit which is always audibly transparent). I believe that this makes the feature usable while still presenting something easily understood by the user.Please let me know if I can explain any of these changes more fully, and thanks again for this contribution!
Recommended: