francisdb / vpin

Rust library for the visual/virtual pinball ecosystem
MIT License
3 stars 1 forks source link

Mono wav file reading broken? #102

Closed francisdb closed 2 weeks ago

francisdb commented 2 weeks ago

mrhector — 08/25/2024 9:36 PM I took a table and converted any stereo wav table sounds to mono since vpx standalone is unable to handle stereo wav files on linux when using 7.1 . I tried to reassemble the table but get an error:

D:\vpxtool>vpxtool assemble "Twilight Zone (Bally 1993) VPW Edition v1.0"
thread 'main' panicked at C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\vpin-0.15.3\src\vpx\wav.rs:154:9:
assertion `left == right` failed
  left: [76, 73, 83, 84]
 right: [100, 97, 116, 97]
stack backtrace:
   0:     0x7ff7c5ead708 - <unknown>
   1:     0x7ff7c5ed0f69 - <unknown>
   2:     0x7ff7c5ea87a1 - <unknown>
   3:     0x7ff7c5ead4e6 - <unknown>
   4:     0x7ff7c5eaf5e8 - <unknown>
   5:     0x7ff7c5eaf257 - <unknown>
   6:     0x7ff7c5eafb18 - <unknown>
   7:     0x7ff7c5eaf9d7 - <unknown>
   8:     0x7ff7c5eae07f - <unknown>
   9:     0x7ff7c5eaf688 - <unknown>
  10:     0x7ff7c5f229a4 - <unknown>
  11:     0x7ff7c5f22cc1 - <unknown>
  12:     0x7ff7c5ef7e48 - <unknown>
  13:     0x7ff7c5883a1a - <unknown>
  14:     0x7ff7c58ecb33 - <unknown>
  15:     0x7ff7c55764c2 - <unknown>
  16:     0x7ff7c54d1d31 - <unknown>
  17:     0x7ff7c55903f4 - <unknown>
  18:     0x7ff7c54fc7a1 - <unknown>
  19:     0x7ff7c5509425 - <unknown>
  20:     0x7ff7c53d4314 - <unknown>
  21:     0x7ff7c53d1dd8 - <unknown>
  22:     0x7ff7c5414cbc - <unknown>
  23:     0x7ff7c53a1006 - <unknown>
  24:     0x7ff7c5ea235e - <unknown>
  25:     0x7ff7c53a106c - <unknown>
  26:     0x7ff7c5ed87cc - <unknown>
  27:     0x7ffcc7c5257d - BaseThreadInitThunk
  28:     0x7ffcc8b2af28 - RtlUserThreadStart
francisdb commented 2 weeks ago

[76, 73, 83, 84] = LIST [100, 97, 116, 97] = data

https://stackoverflow.com/questions/63929283/what-is-a-list-chunk-in-a-riff-wav-header

francisdb commented 2 weeks ago

https://www.reddit.com/r/DSP/comments/fwi4os/comment/fmq3jhz/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

francisdb commented 2 weeks ago

Might be better to switch to https://docs.rs/hound/latest/hound/ instead of reinventing the wheel.

mrhector commented 2 weeks ago

From our conversation on Discord. I run the following command in a powershell script to convert a stereo wav file to mono

ffmpeg -i inputfile.wav -ac 1 outputfile.wav

Attached are a couple examples of the wav files. I'll include the originals and the ones I've converted. This particular table, most of the existing wav files are already mono and I'm able to extract / reassemble the table if I don't make any changes. wav_examples.zip

francisdb commented 2 weeks ago

Thanks, should be fixed in https://github.com/francisdb/vpxtool/releases/tag/v0.13.10

mrhector commented 2 weeks ago

Thanks! Noticed there are no binaries for that release. I think the release step was skipped for some reason in the github action.

francisdb commented 2 weeks ago

@mrhector was because the release was marked as draft, they are available now