mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 13:37:59 +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
@@ -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