File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ int main() {
9
9
// Change "audio.mp3" to your audio file location
10
10
auto transcription = openai::audio ().transcribe (R"(
11
11
{
12
- "file": "audio.wav ",
12
+ "file": "audio.mp3 ",
13
13
"model": "whisper-1"
14
14
}
15
15
)" _json);
16
16
std::cout << " Response is:\n " << transcription.dump (2 ) << ' \n ' ;
17
17
}
18
- /*
18
+
19
19
{
20
20
// Change "german.m4a" to your audio file location
21
21
auto translation = openai::audio ().translate (R"(
@@ -26,6 +26,6 @@ int main() {
26
26
)" _json);
27
27
std::cout << " Response is:\n " << translation.dump (2 ) << ' \n ' ;
28
28
}
29
- */
29
+
30
30
}
31
31
Original file line number Diff line number Diff line change @@ -74,19 +74,18 @@ class Session {
74
74
75
75
~Session () {
76
76
curl_easy_cleanup (curl_);
77
- // curl_global_cleanup();
77
+ curl_global_cleanup ();
78
78
if (mime_form_ != nullptr ) {
79
79
curl_mime_free (mime_form_);
80
80
}
81
81
}
82
82
83
83
void initCurl () {
84
- // curl_global_init(CURL_GLOBAL_ALL);
84
+ curl_global_init (CURL_GLOBAL_ALL);
85
85
curl_ = curl_easy_init ();
86
86
if (curl_ == nullptr ) {
87
87
throw std::runtime_error (" curl cannot initialize" ); // here we throw it shouldn't happen
88
88
}
89
- // 设置这个防止多线程调用崩溃
90
89
curl_easy_setopt (curl_, CURLOPT_NOSIGNAL, 1 );
91
90
}
92
91
You can’t perform that action at this time.
0 commit comments