feat: compression
This commit is contained in:
1 parent
37fbe5d787
commit
b161f81913
2 files changed
+7
-4
No files matched your search
@@ -36,7 +36,8 @@ transui # same as record
|
|||||||
|
|
||||||
Bind `transui record` to a shortcut in your desktop environment. Transui does
|
Bind `transui record` to a shortcut in your desktop environment. Transui does
|
||||||
not register a global shortcut itself. Press the same shortcut again to stop
|
not register a global shortcut itself. Press the same shortcut again to stop
|
||||||
and transcribe the current recording.
|
and transcribe the current recording. Audio is recorded as 16 kHz mono MP3 at
|
||||||
|
32 kbps to keep uploads small.
|
||||||
|
|
||||||
The **Hosted first, local fallback** setting tries the Hosted endpoint, then
|
The **Hosted first, local fallback** setting tries the Hosted endpoint, then
|
||||||
the Local endpoint when the first request fails. With it disabled, Transui uses
|
the Local endpoint when the first request fails. With it disabled, Transui uses
|
||||||
|
|||||||
+5
-3
@@ -330,8 +330,8 @@ bool transcription_request(const std::string& url, const std::string& key,
|
|||||||
part = curl_mime_addpart(mime);
|
part = curl_mime_addpart(mime);
|
||||||
curl_mime_name(part, "file");
|
curl_mime_name(part, "file");
|
||||||
curl_mime_filedata(part, path.c_str());
|
curl_mime_filedata(part, path.c_str());
|
||||||
curl_mime_filename(part, "recording.wav");
|
curl_mime_filename(part, "recording.mp3");
|
||||||
curl_mime_type(part, "audio/wav");
|
curl_mime_type(part, "audio/mpeg");
|
||||||
if (!prompt.empty()) {
|
if (!prompt.empty()) {
|
||||||
part = curl_mime_addpart(mime);
|
part = curl_mime_addpart(mime);
|
||||||
curl_mime_name(part, "prompt");
|
curl_mime_name(part, "prompt");
|
||||||
@@ -568,7 +568,9 @@ void start_recording(App* app) {
|
|||||||
app->recording_path = template_path;
|
app->recording_path = template_path;
|
||||||
g_free(template_path);
|
g_free(template_path);
|
||||||
gchar* pipeline_text = g_strdup_printf(
|
gchar* pipeline_text = g_strdup_printf(
|
||||||
"autoaudiosrc ! audioconvert ! audioresample ! wavenc ! filesink location=\"%s\"",
|
"autoaudiosrc ! audioconvert ! audioresample ! "
|
||||||
|
"audio/x-raw,format=S16LE,rate=16000,channels=1 ! "
|
||||||
|
"lamemp3enc target=bitrate bitrate=32 cbr=true ! filesink location=\"%s\"",
|
||||||
app->recording_path.c_str());
|
app->recording_path.c_str());
|
||||||
GError* error = nullptr;
|
GError* error = nullptr;
|
||||||
app->pipeline = gst_parse_launch(pipeline_text, &error);
|
app->pipeline = gst_parse_launch(pipeline_text, &error);
|
||||||
|
|||||||
Reference in new issue
Block a user