mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 23:53:48 +00:00
Added a configurable Opus bitrate for audio transcription
This commit is contained in:
1 parent
557d0b1409
commit
6be958eb92
14 files changed
+140
-20
No files matched your search
@@ -112,6 +112,11 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
|
||||
/// </summary>
|
||||
public string UseTranscriptionProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UseTranscriptionProvider, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// The Opus bitrate used when normalizing uploaded audio/video for transcription.
|
||||
/// </summary>
|
||||
public TranscriptionOpusBitrate OpusBitrate { get; set; } = ManagedConfiguration.Register(configSelection, n => n.OpusBitrate, TranscriptionOpusBitrate.KBPS_128);
|
||||
|
||||
/// <summary>
|
||||
/// The global keyboard shortcut for toggling voice recording.
|
||||
/// Uses Tauri's shortcut format, e.g., "CmdOrControl+1" (Cmd+1 on macOS, Ctrl+1 on Windows/Linux).
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public enum TranscriptionOpusBitrate
|
||||
{
|
||||
KBPS_32,
|
||||
KBPS_64,
|
||||
KBPS_128,
|
||||
KBPS_256,
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class TranscriptionOpusBitrateExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(TranscriptionOpusBitrateExtensions).Namespace, nameof(TranscriptionOpusBitrateExtensions));
|
||||
|
||||
public static string GetName(this TranscriptionOpusBitrate bitrate) => bitrate switch
|
||||
{
|
||||
TranscriptionOpusBitrate.KBPS_32 => TB("32 kbps (smallest upload, lowest accuracy)"),
|
||||
TranscriptionOpusBitrate.KBPS_64 => TB("64 kbps"),
|
||||
TranscriptionOpusBitrate.KBPS_128 => TB("128 kbps (recommended)"),
|
||||
TranscriptionOpusBitrate.KBPS_256 => TB("256 kbps (largest upload, highest accuracy)"),
|
||||
_ => TB("Unknown"),
|
||||
};
|
||||
|
||||
public static uint GetBitsPerSecond(this TranscriptionOpusBitrate bitrate) => bitrate switch
|
||||
{
|
||||
TranscriptionOpusBitrate.KBPS_32 => 32_000,
|
||||
TranscriptionOpusBitrate.KBPS_64 => 64_000,
|
||||
TranscriptionOpusBitrate.KBPS_128 => 128_000,
|
||||
TranscriptionOpusBitrate.KBPS_256 => 256_000,
|
||||
_ => 32_000,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user