sahlberg / pop-fe

Python script to automate the process of fetching boxart and installing PS1 games (onto your PSP/VITA/PS2/PS3)
161 stars 15 forks source link

SND0 sounds a bit pitched up #24

Closed AceJoyBro closed 1 year ago

AceJoyBro commented 1 year ago

I don't understand what I'm doing wrong. I set my .wav file to be 16bit/44100/Stereo but on the XMB it sounds a bit pitched and speed up. I want to add a SND0 for XMB for the NTSC version of Metal Gear Solid in case that helps, and I used Adobe Audition to convert the file to the specifications above and .wav Screenshot 2023-01-15 192611 Screenshot 2023-01-15 193053

sahlberg commented 1 year ago

I see this is NTSC version of the game. Can you try the very latest version? I fixed an issue with NTSC audio a while back.

Also, you don't need to convert the audio anymore. It should happen automatically now. Just give it an audiofile in any format (or just provide a youtube link instead of a file name)

AceJoyBro commented 1 year ago

The problem still persists. I tried the latest version with the fix for RAYMAN but it still sounds pitched up. Every time I use a YouTube link it says this:

Fetching SND0 Try URL http://www.hwc.nat.cu/psx/SLUS_005.94_COV.jpg Falling back to PSXDATACENTRE for cover Unexpected renderer encountered. Renderer name: dict_keys(['reelShelfRenderer']) Search term: METAL GEAR SOLID encounter ps1 ost Please open an issue at https://github.com/pytube/pytube/issues and provide this log output.

And after I press "Create PKG" it says this:

0 SLUS00594 DISC SLUS00594 TITLE METAL GEAR SOLID encounter Scanning for audio tracks ffmpeg version 5.1.2-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12.1.0 (Rev2, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-font onfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libx id --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enab e-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enab e-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-lib pencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\user\OneDrive\Desktop\PS3 Stuff\pop-fe./Metal Gear Solid 1 - Encoun er.mp4': Metadata: major_brand : dash minor_version : 0 compatible_brands: iso6mp41 creation_time : 2019-12-25T08:57:01.000000Z Duration: 00:02:20.53, start: 0.000000, bitrate: 48 kb/s Stream #0:00x1: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default) Metadata: creation_time : 2019-12-25T08:57:01.000000Z handler_name : ISO Media file produced by Google Inc. vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to './snd0.wav': Metadata: major_brand : dash minor_version : 0 compatible_brands: iso6mp41 ISFT : Lavf59.27.100 Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s (default) Metadata: creation_time : 2019-12-25T08:57:01.000000Z handler_name : ISO Media file produced by Google Inc. vendor_id : [0][0][0][0] encoder : Lavc59.37.100 pcm_s16le size= 24208kB time=00:02:20.52 bitrate=1411.2kbits/s speed= 601x video:0kB audio:24208kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000315% GameID pop-fe-ps3-work/SLUS00594 Creating SND0.AT3 Creating temporary WAV file clamped to 299 second duration ./SND0.WAV 0 132300 WARNING: ATRAC3 is uncompleted, result will be not good ))) bitrate 132300

Oddly enough, when I select my WAV file it doesn't give the same error but this:

0 SLUS00594 DISC SLUS00594 TITLE METAL GEAR SOLID Scanning for audio tracks GameID pop-fe-ps3-work/SLUS00594 Creating SND0.AT3 Unknown chunk type b'DISP' Unknown chunk type b'iXML' Unknown chunk type b'_PMX' Creating temporary WAV file clamped to 299 second duration ./SND0.WAV Unknown chunk type b'DISP' Unknown chunk type b'iXML' Unknown chunk type b'_PMX' Unknown chunk type b'DISP' Unknown chunk type b'iXML' Unknown chunk type b'PMX\x11' 0 132300 WARNING: ATRAC3 is uncompleted, result will be not good ))) bitrate 132300 End of input file.

sahlberg commented 1 year ago

The first case where it fetches the audio fro youtube does not look like an error. This text "WARNING: ATRAC3 is uncompleted, result will be not good )))" is from the converter software, atracdenc, and is normal. It is just an indication that AT3 is a proprietary format and atracdenc is a reverse engineered implementation of it that is not hi-fi quality. The audio is still more than adequate for xmb background music.

The second seem like a genuine error. The conversion from userprovided WAV files is limited and really only implements as much as is needed to convert the files that ffmpeg produces, hence I think the complaints about the unknown chunk types. Make sure to use a commandline like this to create the wav files: ffmpeg -i Azure\ Dreams\ OST\ 3.\ Overture.3gp -ar 44100 -ac 2 Azure\ Dreams\ OST\ 3.\ Overture.wav that should ensure they are in a good format that the conversion can handle.

sahlberg commented 1 year ago

I am pretty terrible at hearing issues with adio but when I encode MGS using the youtupe aduio the results do sound good to me. But that could just be I am terrible at hearing these issues.

You could try to tweak the bitrate that ffmpeg generates in the example above to something slightly higher/lower and see what works best. -ar 41000 ?

AceJoyBro commented 1 year ago

I tried the method you mentioned but the exact same stuff happened. It was the same pitch and speed like before. This is what the console says in case it's helpful.

0 SLUS00776 DISC SLUS00776 TITLE METAL GEAR SOLID Scanning for audio tracks GameID pop-fe-ps3-work/SLUS00776 Creating SND0.AT3 Creating temporary WAV file clamped to 299 second duration ./SND0.WAV 0 132300 WARNING: ATRAC3 is uncompleted, result will be not good ))) bitrate 132300 End of input file.

Apparently, it solved the chunk problem but the high pitch is still there

sahlberg commented 1 year ago

Can you try the artefact on this page: https://github.com/sahlberg/pop-fe/actions/runs/4080406151

I slow it down by 9% I think it might have been a 44200 vs 40100 Hz issue

sahlberg commented 1 year ago

Fixed in latest version of pop-fe.

AceJoyBro commented 1 year ago

For me it's partially fixed. The speed normal but the pitch is still higher than usual. I don't really know how to show you the result on the XMB but if you do, please let me know.