Skip to content

Commit

Permalink
Bumped dependency / Fix stereo issue for some devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurema committed Aug 18, 2023
1 parent 4d8b0fa commit a2eb045
Show file tree
Hide file tree
Showing 5 changed files with 5,213 additions and 5,066 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
Expand Down Expand Up @@ -72,15 +72,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
<Version>2.4.1.2</Version>
<Version>2.6.1.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2478" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<PackageReference Include="Xamarin.Google.UserMessagingPlatform">
<Version>2.0.0.1</Version>
<Version>2.0.0.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Ads">
<Version>120.4.0</Version>
<Version>122.1.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ public static (Java.Util.Locale, string) GetLocalized(int key)

public static async Task SpeakLeft()
{
//Some device can't handle the value -1.0 and 1.0 in float. I can't believe it...
var local = GetLocalized(Resource.String.word_left);
await SpeakWithPan(local.Item2, -1.0f, local.Item2.ToUpperInvariant() == "LEFT" && Content.IsLanguageAvailable(Java.Util.Locale.English)>=LanguageAvailableResult.Available ? Java.Util.Locale.English : local.Item1);
await SpeakWithPan(local.Item2, -0.999999f, local.Item2.ToUpperInvariant() == "LEFT" && Content.IsLanguageAvailable(Java.Util.Locale.English)>=LanguageAvailableResult.Available ? Java.Util.Locale.English : local.Item1);
}

public static async Task SpeakRight()
{
var local = GetLocalized(Resource.String.word_right);
await SpeakWithPan(local.Item2, +1.0f, local.Item2.ToUpperInvariant() == "RIGHT" && Content.IsLanguageAvailable(Java.Util.Locale.English) >= LanguageAvailableResult.Available ? Java.Util.Locale.English : local.Item1);
await SpeakWithPan(local.Item2, +0.999999f, local.Item2.ToUpperInvariant() == "RIGHT" && Content.IsLanguageAvailable(Java.Util.Locale.English) >= LanguageAvailableResult.Available ? Java.Util.Locale.English : local.Item1);
}

public static async Task WaitReadyAsync()
Expand All @@ -100,7 +101,7 @@ public static async Task SpeakWithPan(string text, float paramPan, Java.Util.Loc
if (!(locale is null)) Content.SetLanguage(locale);
var bundle = new Bundle();
if (paramPan != 0.0f) bundle.PutFloat(TextToSpeech.Engine.KeyParamPan, paramPan);
bundle.PutFloat(TextToSpeech.Engine.KeyParamVolume, 1.0f);
bundle.PutFloat(TextToSpeech.Engine.KeyParamVolume, 1.0f);
Content.Speak(text, QueueMode.Add, bundle, Guid.NewGuid().ToString());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="12" android:versionName="1.5.2" package="com.github.kurema.earphoneleftandright" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="13" android:versionName="1.5.3" package="com.github.kurema.earphoneleftandright" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<application android:label="@string/app_name" android:theme="@style/MainTheme" android:icon="@mipmap/icon">
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-2283413819561540~1209019860" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
Expand Down
Loading

0 comments on commit a2eb045

Please sign in to comment.