update resmapled file documentation
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to whisper_live's documentation!
|
||||
Welcome to Whisper Live documentation!
|
||||
========================================
|
||||
|
||||
.. toctree::
|
||||
@@ -14,6 +14,7 @@ Welcome to whisper_live's documentation!
|
||||
:members:
|
||||
|
||||
.. automodule:: whisper_live.client
|
||||
:members:
|
||||
|
||||
|
||||
|
||||
|
||||
+58
-3
@@ -33,11 +33,14 @@
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
<a href="#A"><strong>A</strong></a>
|
||||
| <a href="#B"><strong>B</strong></a>
|
||||
| <a href="#C"><strong>C</strong></a>
|
||||
| <a href="#D"><strong>D</strong></a>
|
||||
| <a href="#F"><strong>F</strong></a>
|
||||
| <a href="#G"><strong>G</strong></a>
|
||||
| <a href="#M"><strong>M</strong></a>
|
||||
| <a href="#O"><strong>O</strong></a>
|
||||
| <a href="#P"><strong>P</strong></a>
|
||||
| <a href="#R"><strong>R</strong></a>
|
||||
| <a href="#S"><strong>S</strong></a>
|
||||
| <a href="#T"><strong>T</strong></a>
|
||||
@@ -53,10 +56,24 @@
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="B">B</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.bytes_to_float_array">bytes_to_float_array() (whisper_live.client.Client static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="C">C</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.server.ServeClient.cleanup">cleanup() (whisper_live.server.ServeClient method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client">Client (class in whisper_live.client)</a>
|
||||
</li>
|
||||
<li><a href="index.html#whisper_live.client.Client.close_websocket">close_websocket() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
@@ -79,6 +96,10 @@
|
||||
|
||||
<h2 id="G">G</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.get_client_socket">get_client_socket() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.server.TranscriptionServer.get_wait_time">get_wait_time() (whisper_live.server.TranscriptionServer method)</a>
|
||||
</li>
|
||||
@@ -100,13 +121,37 @@
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="O">O</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.on_message">on_message() (whisper_live.client.Client static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.on_open">on_open() (whisper_live.client.Client static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="P">P</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.play_file">play_file() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="R">R</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.record">record() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
<li><a href="index.html#whisper_live.server.TranscriptionServer.recv_audio">recv_audio() (whisper_live.server.TranscriptionServer method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.resample">resample() (in module whisper_live.client)</a>
|
||||
</li>
|
||||
<li><a href="index.html#whisper_live.server.TranscriptionServer.run">run() (whisper_live.server.TranscriptionServer method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
@@ -115,10 +160,12 @@
|
||||
<h2 id="S">S</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.server.ServeClient">ServeClient (class in whisper_live.server)</a>
|
||||
<li><a href="index.html#whisper_live.client.Client.send_packet_to_server">send_packet_to_server() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.server.ServeClient">ServeClient (class in whisper_live.server)</a>
|
||||
</li>
|
||||
<li><a href="index.html#whisper_live.server.ServeClient.speech_to_text">speech_to_text() (whisper_live.server.ServeClient method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
@@ -126,6 +173,10 @@
|
||||
|
||||
<h2 id="T">T</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.TranscriptionClient">TranscriptionClient (class in whisper_live.client)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.server.TranscriptionServer">TranscriptionServer (class in whisper_live.server)</a>
|
||||
</li>
|
||||
@@ -150,8 +201,6 @@
|
||||
<li><a href="index.html#module-whisper_live.client">module</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li>
|
||||
whisper_live.server
|
||||
|
||||
@@ -160,6 +209,12 @@
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="index.html#whisper_live.client.Client.write_audio_frames_to_file">write_audio_frames_to_file() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
<li><a href="index.html#whisper_live.client.Client.write_output_recording">write_output_recording() (whisper_live.client.Client method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
|
||||
+196
-4
@@ -5,7 +5,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<title>Welcome to whisper_live’s documentation! — whisper_live documentation</title>
|
||||
<title>Welcome to Whisper Live documentation! — whisper_live documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4f649999" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=039e1c02" />
|
||||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="welcome-to-whisper-live-s-documentation">
|
||||
<h1>Welcome to whisper_live’s documentation!<a class="headerlink" href="#welcome-to-whisper-live-s-documentation" title="Link to this heading">¶</a></h1>
|
||||
<section id="welcome-to-whisper-live-documentation">
|
||||
<h1>Welcome to Whisper Live documentation!<a class="headerlink" href="#welcome-to-whisper-live-documentation" title="Link to this heading">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
</div>
|
||||
<dl class="py class" id="module-whisper_live.server">
|
||||
@@ -219,9 +219,201 @@ port (int): The port number to bind the server.</p>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class" id="module-whisper_live.client">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client">
|
||||
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">whisper_live.client.</span></span><span class="sig-name descname"><span class="pre">Client</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">host</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_multilingual</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lang</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">translate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Represents a client for audio recording and streaming to a server using WebSocket communication.</p>
|
||||
<p>This class allows audio recording from the microphone or playing audio from a file while streaming it to
|
||||
a server for transcription or translation. It uses PyAudio for audio recording and playback and WebSocket
|
||||
for communication with the server.</p>
|
||||
<dl class="simple">
|
||||
<dt>Attributes:</dt><dd><p>CHUNK (int): The size of audio chunks for recording and playback.
|
||||
FORMAT: The audio format used by PyAudio (paInt16 for 16-bit PCM).
|
||||
CHANNELS (int): The number of audio channels (1 for mono).
|
||||
RATE (int): The audio sampling rate in Hz (samples per second).
|
||||
RECORD_SECONDS (int): The maximum duration for audio recording in seconds.
|
||||
RECORDING (bool): Indicates whether recording is currently active.
|
||||
multilingual (bool): Indicates if multilingual transcription is enabled.
|
||||
language (str): The selected language for transcription.
|
||||
task (str): The transcription or translation task to be performed.
|
||||
uid (str): A unique identifier for the client.
|
||||
WAITING (bool): Indicates if the client is waiting for server availability.
|
||||
LAST_RESPONSE_RECIEVED (float): Timestamp of the last response received from the server.
|
||||
DISCONNECT_IF_NO_RESPONSE_FOR (int): Maximum time without server response before disconnection.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.bytes_to_float_array">
|
||||
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">bytes_to_float_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">audio_bytes</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.bytes_to_float_array" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Convert audio data from bytes to a NumPy float array.</p>
|
||||
<p>It assumes that the audio data is in 16-bit PCM format. The audio data is normalized to
|
||||
have values between -1 and 1.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>audio_bytes (bytes): Audio data in bytes.</p>
|
||||
</dd>
|
||||
<dt>Returns:</dt><dd><p>np.ndarray: A NumPy array containing the audio data as float values normalized between -1 and 1.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.close_websocket">
|
||||
<span class="sig-name descname"><span class="pre">close_websocket</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.close_websocket" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Close the WebSocket connection and join the WebSocket thread.</p>
|
||||
<p>First attempts to close the WebSocket connection using <cite>self.client_socket.close()</cite>. After
|
||||
closing the connection, it joins the WebSocket thread to ensure proper termination.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.get_client_socket">
|
||||
<span class="sig-name descname"><span class="pre">get_client_socket</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.get_client_socket" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Get the WebSocket client socket instance.</p>
|
||||
<dl class="simple">
|
||||
<dt>Returns:</dt><dd><p>WebSocketApp: The WebSocket client socket instance currently in use by the client.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.on_message">
|
||||
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">on_message</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ws</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.on_message" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Callback function called when a message is received from the server.</p>
|
||||
<p>It updates various attributes of the client based on the received message, including
|
||||
recording status, language detection, and server messages. If a disconnect message
|
||||
is received, it sets the recording status to False.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>ws (websocket.WebSocketApp): The WebSocket client instance.
|
||||
message (str): The received message from the server.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.on_open">
|
||||
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">on_open</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ws</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.on_open" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Callback function called when the WebSocket connection is successfully opened.</p>
|
||||
<p>Sends an initial configuration message to the server, including client UID, multilingual mode,
|
||||
language selection, and task type.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>ws (websocket.WebSocketApp): The WebSocket client instance.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.play_file">
|
||||
<span class="sig-name descname"><span class="pre">play_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.play_file" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Play an audio file and send it to the server for processing.</p>
|
||||
<p>Reads an audio file, plays it through the audio output, and simultaneously sends
|
||||
the audio data to the server for processing. It uses PyAudio to create an audio
|
||||
stream for playback. The audio data is read from the file in chunks, converted to
|
||||
floating-point format, and sent to the server using WebSocket communication.
|
||||
This method is typically used when you want to process pre-recorded audio and send it
|
||||
to the server in real-time.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>filename (str): The path to the audio file to be played and sent to the server.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.record">
|
||||
<span class="sig-name descname"><span class="pre">record</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">out_file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'output_recording.wav'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.record" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Record audio data from the input stream and save it to a WAV file.</p>
|
||||
<p>Continuously records audio data from the input stream, sends it to the server via a WebSocket
|
||||
connection, and simultaneously saves it to multiple WAV files in chunks. It stops recording when
|
||||
the <cite>RECORD_SECONDS</cite> duration is reached or when the <cite>RECORDING</cite> flag is set to <cite>False</cite>.</p>
|
||||
<p>Audio data is saved in chunks to the “chunks” directory. Each chunk is saved as a separate WAV file.
|
||||
The recording will continue until the specified duration is reached or until the <cite>RECORDING</cite> flag is set to <cite>False</cite>.
|
||||
The recording process can be interrupted by sending a KeyboardInterrupt (e.g., pressing Ctrl+C). After recording,
|
||||
the method combines all the saved audio chunks into the specified <cite>out_file</cite>.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>out_file (str, optional): The name of the output WAV file to save the entire recording. Default is “output_recording.wav”.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.send_packet_to_server">
|
||||
<span class="sig-name descname"><span class="pre">send_packet_to_server</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.send_packet_to_server" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Send an audio packet to the server using WebSocket.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>message (bytes): The audio data packet in bytes to be sent to the server.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.write_audio_frames_to_file">
|
||||
<span class="sig-name descname"><span class="pre">write_audio_frames_to_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frames</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.write_audio_frames_to_file" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Write audio frames to a WAV file.</p>
|
||||
<p>The WAV file is created or overwritten with the specified name. The audio frames should be
|
||||
in the correct format and match the specified channel, sample width, and sample rate.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>frames (bytes): The audio frames to be written to the file.
|
||||
file_name (str): The name of the WAV file to which the frames will be written.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.Client.write_output_recording">
|
||||
<span class="sig-name descname"><span class="pre">write_output_recording</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n_audio_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">out_file</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.Client.write_output_recording" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Combine and save recorded audio chunks into a single WAV file.</p>
|
||||
<p>The individual audio chunk files are expected to be located in the “chunks” directory. Reads each chunk
|
||||
file, appends its audio data to the final recording, and then deletes the chunk file. After combining
|
||||
and saving, the final recording is stored in the specified <cite>out_file</cite>.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>n_audio_file (int): The number of audio chunk files to combine.
|
||||
out_file (str): The name of the output WAV file to save the final recording.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.TranscriptionClient">
|
||||
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">whisper_live.client.</span></span><span class="sig-name descname"><span class="pre">TranscriptionClient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">host</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_multilingual</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lang</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">translate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.TranscriptionClient" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Client for handling audio transcription tasks via a WebSocket connection.</p>
|
||||
<p>Acts as a high-level client for audio transcription tasks using a WebSocket connection. It can be used
|
||||
to send audio data for transcription to a server and receive transcribed text segments.</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>host (str): The hostname or IP address of the server.
|
||||
port (int): The port number to connect to on the server.
|
||||
is_multilingual (bool, optional): Indicates whether the transcription should support multiple languages (default is False).
|
||||
lang (str, optional): The primary language for transcription (used if <cite>is_multilingual</cite> is False). Default is None, which defaults to English (‘en’).
|
||||
translate (bool, optional): Indicates whether translation tasks are required (default is False).</p>
|
||||
</dd>
|
||||
<dt>Attributes:</dt><dd><p>client (Client): An instance of the underlying Client class responsible for handling the WebSocket connection.</p>
|
||||
</dd>
|
||||
<dt>Example:</dt><dd><p>To create a TranscriptionClient and start transcription on microphone audio:
|
||||
<code class="docutils literal notranslate"><span class="pre">`python</span>
|
||||
<span class="pre">transcription_client</span> <span class="pre">=</span> <span class="pre">TranscriptionClient(host="localhost",</span> <span class="pre">port=9090,</span> <span class="pre">is_multilingual=True)</span>
|
||||
<span class="pre">transcription_client()</span>
|
||||
<span class="pre">`</span></code></p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py function">
|
||||
<dt class="sig sig-object py" id="whisper_live.client.resample">
|
||||
<span class="sig-prename descclassname"><span class="pre">whisper_live.client.</span></span><span class="sig-name descname"><span class="pre">resample</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sr</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">16000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#whisper_live.client.resample" title="Link to this definition">¶</a></dt>
|
||||
<dd><p># <a class="reference external" href="https://github.com/openai/whisper/blob/7858aa9c08d98f75575035ecd6481f462d66ca27/whisper/audio.py#L22">https://github.com/openai/whisper/blob/7858aa9c08d98f75575035ecd6481f462d66ca27/whisper/audio.py#L22</a>
|
||||
Open an audio file and read as mono waveform, resampling as necessary,
|
||||
save the resampled audio</p>
|
||||
<dl class="simple">
|
||||
<dt>Args:</dt><dd><p>file (str): The audio file to open
|
||||
sr (int): The sample rate to resample the audio if necessary</p>
|
||||
</dd>
|
||||
<dt>Returns:</dt><dd><p>resampled_file (str): The resampled audio file</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</section>
|
||||
<section id="indices-and-tables">
|
||||
<span id="module-whisper_live.client"></span><h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Link to this heading">¶</a></h1>
|
||||
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Link to this heading">¶</a></h1>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
# Project: whisper_live
|
||||
# Version:
|
||||
# The remainder of this file is compressed using zlib.
|
||||
xÚ“¿nà Æw?U»5kÖN*Er¤ŽˆÂÅF€à°ã¯Ñ×ë“%u¤¨ëLÀÝ÷ýîø×7*8ðL«¨Ð
|
||||
7l[+£òH”‘p¤
|
||||
¶ú>ÇÊRýÜÀwàÿç¢Õ8<�ë
|
||||
xÚUËnÂ0¼ç+\µ×Dåʵ§JT‰JÅ^«ŽmùAÈßׯ@A hNIvwÆû˜uºF8ƒ–J±ÁŠI�ÊÓÏ[̓DòJ„â¸ßÊçl+_HYt—¨êífœ#³SìmPµê=:ê5]K
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user