RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
232 stars 28 forks source link

Just play audio with 0.7 playbackRate, the audio sounds like double times played at same time. #1763

Closed polaris7765 closed 6 months ago

polaris7765 commented 6 months ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue A clear and concise description of what the issue is.

Your Setup (please complete the following information):

To Reproduce

  1. add Mediaplayer component to a game object
  2. settings -> mediaPlayer.m_VideoPath = fullFilePath; mediaPlayer.m_PlaybackRate = 0.7f; mediaPlayer.m_Loop = false; mediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, fullFilePath);
  3. playback on mac book unity editor is prefect.
  4. published ios build and test on iphone XR (ios14.0.1)
  5. the playback sounds like have echo sound

Logs no error message

Chris-RH commented 6 months ago

Hi @polaris7765,

AVPro Video version 1 was depreciated 3 years ago and is no longer receiving any updates. I would advise that you upgrade to the latest version, which is 1.11.7 and retest. You could also try slightly different playback rates, such as 0.5, to see if they work any better.

polaris7765 commented 6 months ago

Hi @polaris7765,

AVPro Video version 1 was depreciated 3 years ago and is no longer receiving any updates. I would advise that you upgrade to the latest version, which is 1.11.7 and retest. You could also try slightly different playback rates, such as 0.5, to see if they work any better.

thanks for your quickly reply! when i updated to leastest version and test on android devices, that will case this problem. the mp3 file path is set in inspector and works in unity Editor. image

logs as below: AVProVideo] Creating player 0 2024-02-21 18:21:14.177 25628-25685 Unity com.Chengdu.iOSApp I [AVProVideo] Initialising AVPro Video v2.9.1 (native plugin v2.9.1f1-trial) on Mali-G76/OpenGL ES 3.2 v1.r18p0-01rel0.eb0c31071d41ebd807505c2a08a74d99 (MT True) on Android 2024-02-21 18:21:14.186 25628-25685 AVProVideo com.Chengdu.iOSApp I CREATED new ExoPlayer object 2024-02-21 18:21:14.187 25628-25685 Unity com.Chengdu.iOSApp I [AVProVideo] Creating player 1 2024-02-21 18:21:14.194 25628-25685 Unity com.Chengdu.iOSApp I [AVProVideo] Opening /data/app/com.Chengdu.iOSApp-ufe8ItmlWzYEoczCOgZAaA==/Assets/Dialogue/9780170103565_2_31.mp3 (offset 0) with API ExoPlayer 2024-02-21 18:21:14.241 25628-25685 AVProVideo com.Chengdu.iOSApp I Video Loading: TYPE_OTHER : No file offset | uri = /data/app/com.Chengdu.iOSApp-ufe8ItmlWzYEoczCOgZAaA==/Assets/Dialogue/9780170103565_2_31.mp3 2024-02-21 18:21:17.355 25628-25685 System.out com.Chengdu.iOSApp I AVProVideo error Source error 2024-02-21 18:21:17.387 25628-25685 Unity com.Chengdu.iOSApp E [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.

Chris-RH commented 6 months ago

Save it to StreamingAssets and play it from there. You may also need to set the permissions: Player Settings > Android > Write Permission > External (SDCard).

polaris7765 commented 6 months ago

thanks again, this time that works. but also have the problem that i mentioned before. the playback sounds like have echo sound when i changed the playbackRate to 0.7f (>= 0.9f is correct). is this related to the platform settings? image

Chris-RH commented 6 months ago

I would guess that what you hear is not an echo but audio artefacts caused by the time stretching algorithm which tries to keep the original pitch while slowing down the tempo

To clarify, which version of AVPro Video are you using now? What sort of audio are you trying to playback slowly? Voice? Music?

Chris-RH commented 6 months ago

Closed due to lack of reply

polaris7765 commented 4 months ago

sorry, it's too late and reply for a closed issue. AVPro Video version is v2.9.1-Trial. i want slowly playback a voice. just like playback someone speak english words.