07th-mod / umineko-question

93 stars 9 forks source link

Voice file is not played by ponscripter #29

Closed marakeusz closed 6 years ago

marakeusz commented 8 years ago

There is line when the voice is not played even if alias (rg3_2e6) is put correctly and the ogg file seems to be fine (checked in external audio player).

stralias rg3_2e6,"voice\40\22500006.ogg"

langen:dwave 0, RG3_2e5:^"Your chest... It's so warm, and it feels so good to pierce it...^@:dwave 0, RG3_2e6:^ Come on, let me have another taste, okay...?^@:dwave 0, RG3_2e7:^ Won't you make me feel really good with that hot fresh blood in that warm chest of yours...?"^\

It does look fine so I can assume that problem is not with the script but the file (voice\40\22500006.ogg) is somehow "not proper enough" for ponscripter to play it? Have no idea.

drojf commented 8 years ago

I re-encoded it from the original .at3 files. For reference (I bet this will happen again), FFMPEG has some issues with encoding/decoding .at3 files, so you have to do the following:

  1. ffmpeg -i 22500006.at3 -ar 44100 -ac 1 22500006.wav output downsampled, mono .wav file
  2. ffmpeg -i 22500006.wav -q 7 22500006.ogg convert .wav file to .ogg

-ar 44100 converts sample rate from 48000 in ps3 version to 44100 (since ponscripter doesn't seem to support 48000 hz files properly)

-ac 1 tells ffmpeg to make it mono (otherwise you just get audio on the left side). Strangely, the umitweak .ogg files are encoded in stereo, even though all the voices are mono.

-q 7 sets the .ogg vorbis output quality

I tried converting it directly from .at3 to .ogg, FFMPEG will give an erroneous length value for the .ogg, and the game will only play 1 second of the file.

Here is the fixed file, it plays fine for me. 22500006.zip

marakeusz commented 8 years ago

Thanks. Do you think there is any way to find such problematic files beside actually playing the game?

drojf commented 8 years ago

I could re-encode all the voice files in a similar way, but that doesn't really check that they play correctly.

The only real way to check is to have the game play it and have something check that it played correctly.

If I were to do it, I would make special game script which is just (play sound, wait for click). Then you make the computer automatically click to advance through voice files one at a time, and check each voice playback.

The simple way to 'validate' the playback is to see if anything came out on the audio output of the computer (most computers can listen to their own outputs these days). But you could actually try to do fingerprinting by using some audio hashing library, and see if the hash matches close enough (I haven't researched audio hashing before). You may even get away with trimming the 'silence' at the start and end of the audio playback, and then diffing the two audio files after normalizing their volumes instead of hashing, since the files should be identical.

I don't know if it's worth the effort though :S.

marakeusz commented 8 years ago

It would be nice to reduce number of such files to minimum but - totally not worth the effort :) Probably after each episode (starting from 2nd) I will upload updated voice files. I am pretty sure it won't be a large amount - it is easy to not notice.

drojf commented 8 years ago

You can find the original .at3 files near the top of this thread, EXCEPT folder 38: https://warosu.org/jp/thread/6806985

You can get folder 38 here.

marakeusz commented 8 years ago

Ok, during my playthrough of episode 2 the 19 cases of not played voice were found.

I was able to fix 9 (1 was already fixed by drojf) files by encoding them again.

stralias rg3_2e6,"voice\40\22500006.ogg stralias bea_2e913,"voice\27\20700913.ogg" stralias geo_2e497,"voice\07\20300497.ogg" stralias but_2e668,"voice\10\20100668.ogg" stralias kan_2e519,"voice\16\20600519.ogg" stralias but_2e1047,"voice\10\20101047.ogg" stralias mar_2e516,"voice\13\20400516.ogg" stralias bea_9e310,"voice\27\90700310.ogg" stralias ber_9e111,"voice\28\92100111.ogg" stralias ber_9e128,"voice\28\92100128.ogg"

I was able to fix 6 voice by updating the script

stralias jes_2e617,"voice\04\20000617.ogg" no such file exist - updated to 20200617.ogg stralias kum_2e102,"voice\18\21800102.ogg" no such file exist - updated to 21800102_b.ogg stralias but_2e779,"voice\10\2010779.ogg" no such file exist - updated to 20100779.ogg

langen:dwave 0, "voice\99\yagif2001.ogg":^"Ahahahahahahaha...^@:dwave 0, "voice\99\yagif2002.ogg":^ Sore loser.^@:dwave 0, "voice\99\yagif2003.ogg":^ She's ticked off, isn't she?"^@ Those files are placed in 29 directory (not 99)

The 3 files I was not able to find anywhere so I could not fix those.

stralias bea_2e1429,"voice\27\20701429.ogg" missing - nowhere to be found (at3 nor ogg) stralias but_2e1219,"voice\10\20101219.ogg" missing - nowhere to be found (at3 nor ogg) stralias but_2e1220,"voice\10\20101220.ogg" missing - nowhere to be found (at3 nor ogg)

I created the pull request with script fixes and below is link to 10 files. https://mega.nz/#!g8hjlRJQ!QOBN8lBWYE-t1nKNhUD_DcsqNIbVL-JNGBPs6sagFZo

drojf commented 8 years ago

I happen to have the original ps3 script file. It's not decoded, but the filenames and text used are in plaintext. None of those 3 files appear anywhere in the script.

as below it goes from 10/20101218 to 10/20101221. The PS3 script appears to skip two lines.

  €M   €M
€A     € A 
€  Hヲ    N
€N    €・5 5 右代宮 戦人rv10/20101216.「アンタが、俺ニ引導ヲ渡シニ来タノカイ」 チ  vツ  ・ツ  €ツ  €ツ  €ツ  €ツ  €ツ  €克
 @  ・5 W 呂ノ上 源次rv14/21600225.「・・・ソノヨウナコトハござイマセン。kv14/21600226.・・オ邪魔ナヨウでシタラ失礼イタシマス」 チ
  Sツ
  rツ
  €ツ
  €ツ
  €ツ
  €ツ
  €ツ
  €克
 @  ・5 ~ 右代宮 戦人rv10/20101217.「・オイオイ、用件モ伝エず失礼シマスじャ、カエッテ気持チ悪イぜ。kv10/20101218.・何ノ用だヨ。kv10/20101221.・最後クライ好キニサセテクレ」 チ  uツ  ・ツ  €ツ  €ツ  €ツ  €ツ  €ツ  €克
 @  ・5 k 呂ノ上 源次rv14/21600227_1.「・・・戦人サマハ、死セル最後ノワずカナ時間ヲ、kv14/21600228_1.ソノヨウニ怠惰ニ過ごサレルコトヲオ望ミでスカ゚」 ・5  rソノ一言ハ、沁ミル・。kr・・ソンナワケモナカッタ。 宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  ・チ  ・ツ  €ツ  €ツ  €ツ  €M    €M
€A     € A 
€  Hヲ    N
€N    €・5 p 右代宮 戦人rv10/20101222.「・・・・・・・・・・。kv10/20101223.今サラ何がでキルッテンだ。kv10/20101224.俺ハイツだッテ死ヌ準備ハ出来テルぜ・」 ・5 _ 呂ノ上 源次rv14/21600229.「・・オ館様ト同じでスナ。kv14/21600230.本当ニアナタハオ館様ノ血ヲ色濃ク受ケ継がレテイル・」 ・5 ` 右代宮 戦人rv10/20101225.「アノ豪傑ナ祖父サマが、実ハイツ死ンでモイイト思ッテタッテノカ・゚kv10/20101226.ソレハ初耳だぜ」 宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  -(#€ネH チ  -(#€ネH チ    チ    M    €M
€A     € A 
€  Hヲ    N
€N    €・5 ・呂ノ上 源次rv14/21600231.「・・・オ館様ノ人生ハ、v14/21600232.・・イクツカノ悲シイ出来事ノ末、v14/21600233.・・全テ、bしょくざい.<贖罪>.ノタメノモノト成リ果テタノでス」 宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  ロチ  レツ  €ツ  €ツ  €ツ  €M  €M
€A     € A 
€  Hヲ    N

likewise 20701429 is not found anywhere in the script, it skips from 20701428 to 20701430:


 チ    チ    チ    チ  ツ   ツ  €ツ  €宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  ケチ  クツ  €ツ  €ツ  €ツ  € Z     チ    ・ツ     ツ   €ツ    €ツ    €ツ    €ツ    €ツ    €ツ   # ・ツ     項ツ   # x ツ      x テ     ・   F     チ     ・ツ     ツ   €ツ    €ツ    €ツ    €ツ    €ツ    €克
 @  ・4 ・ベアトリーチェrv27/20701423.「・・・紗音。kv27/20701424.ルーレットハソナタト譲治ヲ選ンだ。kv27/20701425.解放ノ日ニ感謝セヨ。kv27/20701426.未練ハアルマイ゚」 チ      aツ      ツ   €ツ    €ツ    €ツ    €ツ    €ツ    €克
 @  ・4  ハ ベアトリーチェrv27/20701427.「ナイヨナァ゚kv27/20701428.惚レタ男カラ婚約指輪ヲモラッテ、夜モ共ニシナイ内ニ殺サレテシマッテモ、未練ナンカナイヨナァアアアァ゚゚゚kv27/20701430.女ノ幸セヲ教エテモライタカッタンだロォオ゚k|yv27/20701431.クッヒヒヒャヒャヒャヒャヒャヒャヒャ゙゙」 ・   F     ・チ    ・ツ     ツ   €ツ    €ツ    €ツ    €ツ    €ツ    €克
 @  ・4  ワ ベアトリーチェrv27/20701432.「アァ紗音ダメダメ、垂レテルぜ゚オ前ノ口元カラ、未練が。kv27/20701433.だラだラ垂レテンノが見エルぜェエエェエ、紗音ンンンンンンゥウゥゥ゚゚゚k|yv27/20701434.ヒーッヒャッヒャハッハハハハハハハハv27/20701435.|yキャーッキャッキャッキャッキャッキャッ゙゙゙」 ・  F     ・  F     ・  -     チ    宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  -(#€ネH チ  -(#€ネH チ    チ    M    €M
€A     € A 
€  Hヲ    N
€N    €・4 % rばキリ。kソレハ宝物箱ノ蓋が壊レテ開イタ音だッタ。 ・4 X r譲治が中身ヲ引ッ繰リ返スト、アクセサリーヤオ守リヤ、w20.・・少女だッタ頃カラ大切ニシテイソウナ様々ナ小物が出テキタ。 ・4 6 r・ソレニ混じリ、一際目立ツbきんちゃくぶくろ.<巾着袋>.がアッタ。 ・4  rソレヲ拾イ、スぐニ確信スル。k・・・コレだッタ。 宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ
    チ    チ    チ    チ    チ    チ  ケチ  クツ  €ツ  €ツ  €ツ  €M  €M
€A     € A 
€  Hヲ    N
€N    €チ
  0ツ
  rツ
  €ツ
  €ツ
  €ツ
  €ツ
  €ツ
  €克
 @  ・4 + 右代宮 譲治rv07/20300716.「見ツケタ・、コレだ・・・」 チ  ・ツ  ・ツ  €ツ  €ツ  €ツ  €ツ  €ツ  €克
 @  ・4 I ベアトリーチェrv27/20701436.「一手及ばナカッタノゥ。kv27/20701437.クッククククククククグ゙」   Z     宴
 チ    チ    チ        チ
    チ    チ    チ    チ    チ

Script file attached if you want to have a look. You'll need to switch the encoding(decoding?) to shift-jis (instead of ANSI) to see the japanese (notepad++ can do this).

main (for 1-4).zip

Although I do wonder where the umitweak guys got the non-existent values from (whether it was just a mistake or they know something we don't).

marakeusz commented 8 years ago

I can imagine that PS3 version is "slightly censored". In one scene Beatrice is mocking Shannon about her not having the "proper" wedding night and in another scene Battler is speaking about him drinking alcohol (he is minor if I remember correctly).

I guess we cannot do anything about it.

grechnik commented 7 years ago

Some problematic files are still present in 2.5 release, starting with voice\01\11500008.ogg from the prologue of the first episode. The problematic files can be detected by an excess header as last 27 bytes: 4F 67 67 53 00 04 FF FF FF FF FF FF FF FF ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 This header means "the last record for the stream (04), a frame with timestamp -1 (0xFF...FF) and no data". It breaks the detection of total play time in libvorbis (which is "find the last frame, take its timestamp and add samples from that frame"). External players can still play the file in streaming mode, but Ponscripter requires total number of samples to be available before the decoding, so it fails.

The following Python script can detect and fix all files: https://gist.github.com/grechnik/2a248b22f3da2939329570170aa7b203

ItaloKnox commented 7 years ago

If someone can run the script and collect the results and push them into a new branch, I'll try to push an update as soon as possible. Unfortunately things are still busy with Higurashi so I can't do that by myself.

grechnik commented 7 years ago

I don't see voice files in the repository, so not sure what "a new branch" should mean, but here is the archive with fixed files: https://diamondz.tk/files/umineko_steam_ps3mod_voicefix.zip

ItaloKnox commented 7 years ago

We put fixed voice lines in the main branches of Higurashi, but your solution is fine as well. I'll see if I can push a new patch in a couple hours. Thanks a lot!

ItaloKnox commented 7 years ago

That was fairly simple so I managed to push the changes quickly enough. Can I consider the issue solved?

grechnik commented 7 years ago

I hope so. Although it may make sense to get a confirmation from the topic starter.

drojf commented 6 years ago

I think this is closed now, however I did find some possible missing voice files here: https://github.com/07th-mod/umineko-question/issues/92 (these files aren't 'corrupted and don't play', they just don't exist on disk at all)