Describe the bug
There's a problem where if i try to change an Audio Music Track, the volume will not be changed
System Details (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The volume of the audio track would have changed
Screenshots
If applicable, add screenshots to help explain your problem.
Logs
If you are experiencing a crash, please collect and attach logs of the problem.
Additional context
This is a error where in, most build versions, the Developer forgot to fix this problem
What values are you using for the Volume property?
The volume is a percent, shown with 0% = 0.00 and 100% = 1.00.
If you want to reduce the volume to 50%, you would use 0.50 in the Volume property.
To boost the volume by 10%, you would use 1.10.
I tried that but with no difference
Perhaps try a right-click on the clip on the timeline, select Volume -> Entire Clip and set the volume % there and see if that works.
Oh, one more thing... Volume is a keyframable property, so you need the playhead to be at the point in the clip where you want the volume change to take effect (or entirely off the clip). If you want the entire clip to be set to a certain volume, you need to have the playhead on the first frame of the clip (or, again, entirely off the clip).
@MrTertius - I just tested this with OpenShot-v2.4.1-115-ge7a99e9-59-697-x86_64.AppImage and OpenShot-v2.4.1-x86_64.AppImage. The daily build will not let me change volume while the v2.4.1 release build will. Thanks for finding this bug and reporting it!
@DylanC - I am thinking this is probably something that @jonoomph would want to be resolved before v2.4.2 is released.
Looking at the libopenshot changes since the 2.4.1 release, I think the issue lies here:
...that line overwrites the value of gainFactor, which was previously set to the clip-specific value of gainToApplyToSource on line 862.
I _think_ the fix may be to change gainFactor = ... to gainFactor *= ... at the start of L865 so that gainFactor is scaled appropriately instead of overwritten. But, since I'm not familiar with that code, and I'm a little low on time today, I can't test that theory myself right now.
@jonoomph - Might be worth looking at before v2.4.2 is released.
Also found the same issue here, reported earlier #1533
Good catch, Sir @DylanC !
I may get chance to look at this today...
Okay... playing around with the code brought some things to light:
Volume -> Start of Clip -> Fade In ... or manual volume changes within the clip done with multiple keyframes) are behave properly because they are applied via ApplyGainRamp()Volume -> Entire Clip -> Level ... or setting a single volume keyframe at the start of the clip) settings are ignored due to https://github.com/OpenShot/libopenshot/blob/1ec9e4426a94181187ac1f039971d7700911abb2/src/Frame.cpp#L865 because fixed volumes are applied to the clip via AddAudio() and that line overwrites the gainToApplyToSource parameter of the function.current_max_volume doesn't appear to be computed correctly, but I'm not familiar with what it is supposed to do, so I'm not going to touch it. I have added a TODO note in the source, though.I will be submitting a PR to fix the fixed volume issues introduced since v2.4.1 was published with hopes that it gets into v2.4.2 before it is released.
@N3WWN - Great research thanks! :)
Solved via pull/90:
https://github.com/OpenShot/libopenshot/pull/90
@MrTertius
Most helpful comment
Okay... playing around with the code brought some things to light:
Volume->Start of Clip->Fade In ...or manual volume changes within the clip done with multiple keyframes) are behave properly because they are applied viaApplyGainRamp()Volume->Entire Clip->Level ...or setting a single volume keyframe at the start of the clip) settings are ignored due to https://github.com/OpenShot/libopenshot/blob/1ec9e4426a94181187ac1f039971d7700911abb2/src/Frame.cpp#L865 because fixed volumes are applied to the clip viaAddAudio()and that line overwrites thegainToApplyToSourceparameter of the function.current_max_volumedoesn't appear to be computed correctly, but I'm not familiar with what it is supposed to do, so I'm not going to touch it. I have added aTODOnote in the source, though.I will be submitting a PR to fix the fixed volume issues introduced since v2.4.1 was published with hopes that it gets into v2.4.2 before it is released.