feat(ads/seo/release): v1.2.0 with live Google Ads, isolated ad profile, ads.txt, and SEO/AEO/GEO optimization
This commit is contained in:
parent
a88aafa1e5
commit
0e568f1f0a
975 changed files with 130593 additions and 16783 deletions
70
tests/Paca.Tests/Core/MediaPlaybackSpeedPitchGateTests.cs
Normal file
70
tests/Paca.Tests/Core/MediaPlaybackSpeedPitchGateTests.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
using System;
|
||||
using Paca.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Core;
|
||||
|
||||
public class MediaPlaybackSpeedPitchGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate341_MediaPlaybackSpeedPitch_BuildsSingleAtempo_ForNormalRange()
|
||||
{
|
||||
var filter15 = MediaPlaybackSpeedPitchEngine.BuildAtempoFilterChain(1.5);
|
||||
Assert.Equal("atempo=1.50", filter15);
|
||||
|
||||
var filter075 = MediaPlaybackSpeedPitchEngine.BuildAtempoFilterChain(0.75);
|
||||
Assert.Equal("atempo=0.75", filter075);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate342_MediaPlaybackSpeedPitch_ChainsAtempo_ForSpeedsExceedingTwo()
|
||||
{
|
||||
// 3.0x -> atempo=2.0,atempo=1.5
|
||||
var filter30 = MediaPlaybackSpeedPitchEngine.BuildAtempoFilterChain(3.0);
|
||||
Assert.Equal("atempo=2.00,atempo=1.50", filter30);
|
||||
|
||||
// 4.0x -> atempo=2.0,atempo=2.0
|
||||
var filter40 = MediaPlaybackSpeedPitchEngine.BuildAtempoFilterChain(4.0);
|
||||
Assert.Equal("atempo=2.00,atempo=2.00", filter40);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate343_MediaPlaybackSpeedPitch_ClampsExtremeSpeeds()
|
||||
{
|
||||
// Min 0.25
|
||||
var min = MediaPlaybackSpeedPitchEngine.ClampSpeed(0.1);
|
||||
Assert.Equal(0.25, min);
|
||||
|
||||
// Max 4.0
|
||||
var max = MediaPlaybackSpeedPitchEngine.ClampSpeed(10.0);
|
||||
Assert.Equal(4.0, max);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate344_MediaPlaybackSpeedPitch_BuildsFullCommandLine_ForVideoAndAudio()
|
||||
{
|
||||
// Video 1.5x
|
||||
var videoCmd = MediaPlaybackSpeedPitchEngine.BuildSpeedCommandLine(
|
||||
inputPath: "C:\\lecture.mp4",
|
||||
outputPath: "C:\\lecture_1.5x.mp4",
|
||||
speed: 1.5,
|
||||
isAudioOnly: false
|
||||
);
|
||||
|
||||
Assert.Contains("-i \"C:\\lecture.mp4\"", videoCmd);
|
||||
Assert.Contains("-filter:v \"setpts=0.6667*PTS\"", videoCmd);
|
||||
Assert.Contains("-filter:a \"atempo=1.50\"", videoCmd);
|
||||
Assert.EndsWith("\"C:\\lecture_1.5x.mp4\" -y", videoCmd);
|
||||
|
||||
// Audio only 2.0x
|
||||
var audioCmd = MediaPlaybackSpeedPitchEngine.BuildSpeedCommandLine(
|
||||
inputPath: "C:\\podcast.mp3",
|
||||
outputPath: "C:\\podcast_2x.mp3",
|
||||
speed: 2.0,
|
||||
isAudioOnly: true
|
||||
);
|
||||
|
||||
Assert.DoesNotContain("-filter:v", audioCmd);
|
||||
Assert.Contains("-filter:a \"atempo=2.00\"", audioCmd);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue