mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-03 09:03:42 -04:00
Herald v2 (#74)
* Add speech rate setting * Add volume slider * New speech manager skeleton * User API key from resx * Implement voice list retrieve via new api * Rewrite to use ObAPI, remove all dependancies * Use volume setting * Clean up using statements * Volume and timing adjustments * Lookup rate value * Use numeric rates for tighter spread * Manage plugin data folder via core interface * Add check that nullable settings are not null. * Get file size before it's deleted. * Improve old settings migration. * Ignore cache sizes below 1MB * Re-index orphaned files in cache, purge legacy wav files. * Call top level error logging for native voice exception. * Async title and detail requests to remove pause * Remove NetCoreAudio use of temp files. * Remove orphan using.
This commit is contained in:
33
ObservatoryHerald/NetCoreAudio/Players/LinuxPlayer.cs
Normal file
33
ObservatoryHerald/NetCoreAudio/Players/LinuxPlayer.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using NetCoreAudio.Interfaces;
|
||||
|
||||
namespace NetCoreAudio.Players
|
||||
{
|
||||
internal class LinuxPlayer : UnixPlayerBase, IPlayer
|
||||
{
|
||||
protected override string GetBashCommand(string fileName)
|
||||
{
|
||||
if (Path.GetExtension(fileName).ToLower().Equals(".mp3"))
|
||||
{
|
||||
return "mpg123 -q";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "aplay -q";
|
||||
}
|
||||
}
|
||||
|
||||
public override Task SetVolume(byte percent)
|
||||
{
|
||||
if (percent > 100)
|
||||
throw new ArgumentOutOfRangeException(nameof(percent), "Percent can't exceed 100");
|
||||
|
||||
var tempProcess = StartBashProcess($"amixer -M set 'Master' {percent}%");
|
||||
tempProcess.WaitForExit();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user