View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001573 | FSSCP | sound | public | 2008-01-14 14:13 | 2008-06-02 15:32 |
| Reporter | WMCoolmon | Assigned To | taylor | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | won't fix | ||
| Summary | 0001573: Num samples in music.tbl does not function properly | ||||
| Description | Using an OGG files, the number of samples in music.tbl does not function properly. The music is terminated early, a little before halfway through using the OGG that I observed this with. Occurs in both stable and unstable branches. | ||||
| Tags | No tags attached. | ||||
|
|
I don't think that this is a code bug. The info in music.tbl is specific the the piece of music in question, and a wav file is different from an ogg, even if it's the same basic audio. See bug 0001285 for more info about this problem when I worked on it last time. It was decided at that point to not try to fool around with any sort of code hack for that stuff and just get the info the table correct in the first place. |
|
|
An OGG still has to be converted to PCM format, and you do need to know the frequency and bitrate of that PCM file, so you ought to be able to keep track of the number of samples regardless of what the source file is. I'm sorry, but after reading that bug report, do you actually know what a sample is? You say "The autodetection is calculating the SPM for that file at 139517. And according to the math, that's correct. It's 88kb/s * 15sec = 137.5ks/m (not as accurate the code gets obviously). This is the issue that I have with the entries in music.tbl, they are completely arbitrary and appear to have no basis in mathematical reality." That's not right at all. A sample is _NOT_ expressed in size. A sample's size may vary, and for the file in question, sample size is 16 bits. That means a sample will be 2 bytes, while a sample for an 8 bit file would be 1 byte. The number of channels and frequency will also make a difference. 2 bytes/sample * 2 channels * 22050 hz = 705.6 kb/s I can correlate this value with Foobar, VLC, and dbPowerAmp The number of samples seems to be 22050 hz * 15.186 seconds = 334842 which I've correlated with foobar and Audacity. Divide that by 4.8 measures: 33484 samples/4.8 measures = 69759 samples/measure Which is very close to the given TBL value of 75600, well within the acceptable range of tweaking-so-it-sounds-correct, or a last minute change to the audio without a change to the table. |
|
|
I know what I sample is, but as I said in the commit of the code to handle this same problem, the math doesn't add up. The math took the calculation based on size. And the math in indeed invalidated later on, which is why I removed the code. But also read what CP5670 said, the time can be (and probably is) and arbitrary value. He already posted the correct formula in the forums and in the other bug report. The problem is that we can't simply guess at the values for time, which is the main thing that we need since the rest we already have. Because of that I decided not to touch it and simply leave it up to the modder to get right. If all that's being done is to change the numbers which changing file types then there is absolutely no reason to make the code do that. |
|
|
My point is, the filetype should be irrelevant so long as the number of samples is correct, because that is independent of filesize or compression. But it does look like the bug is independent of filetype; I converted the OGG to a wave and tried it again, and had the same problem. Doubling the number of samples does fix the problem, but both Audacity and Foobar agree that original the number I entered is correct. The file is a 44100hz, 16-bit, 2-channel OGG of 168.400 seconds in length; I used 7426440 and it plays halfway through, while doubling it to 14852880 causes the entire file to play. I converted it to a wave file of the same format and had the same problem occur. I can't upload the file here because it's copyrighted, so contact me via PM if you need a copy for testing purposes. |
|
|
Not going to do anything code wise about this. It's completely on the mod maker to get right because there is no way to handle this without making totally retarded code hacks. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2008-01-14 14:13 | WMCoolmon | New Issue | |
| 2008-01-14 14:18 | WMCoolmon | Description Updated | |
| 2008-01-14 14:18 | WMCoolmon | Status | new => assigned |
| 2008-01-14 14:18 | WMCoolmon | Assigned To | => taylor |
| 2008-01-15 01:29 | WMCoolmon | Category | --------- => sound |
| 2008-02-11 05:56 | taylor | Note Added: 0008863 | |
| 2008-02-11 07:42 | WMCoolmon | Note Added: 0008868 | |
| 2008-02-11 07:46 | WMCoolmon | Note Edited: 0008868 | |
| 2008-02-11 08:10 | taylor | Note Added: 0008869 | |
| 2008-02-11 09:47 | WMCoolmon | Note Added: 0008870 | |
| 2008-02-11 09:48 | WMCoolmon | Note Edited: 0008870 | |
| 2008-06-02 15:32 | taylor | Status | assigned => resolved |
| 2008-06-02 15:32 | taylor | Resolution | open => won't fix |
| 2008-06-02 15:32 | taylor | Note Added: 0009373 |