Skip to content

Commit

Permalink
Add docs and support mp3
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybchris committed Apr 23, 2024
1 parent 30719b0 commit f0cdd06
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 12 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
shell: bash
run: |
sudo apt-get --yes update
sudo apt-get --yes install ffmpeg
- name: Install Python dependencies
shell: bash
run: |
Expand Down Expand Up @@ -97,6 +103,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
shell: bash
run: |
sudo apt-get --yes update
sudo apt-get --yes install ffmpeg
- name: Install Python dependencies
shell: bash
run: |
Expand Down Expand Up @@ -150,7 +162,7 @@ jobs:
shell: bash
run: |
sudo apt-get --yes update
sudo apt-get --yes install libasound2-dev libportaudio2
sudo apt-get --yes install libasound2-dev libportaudio2 ffmpeg
- name: Install Python dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"flake8.args": ["--max-line-length", "120"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": true,
"editor.formatOnSave": true,
// "editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.rulers": [120],
"isort.args": ["--settings-file", "pyproject.toml"],
Expand Down
2 changes: 1 addition & 1 deletion docs/batch/batch-job-details.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.batch_job_details.BatchJobDetails
::: hume._measurement.batch.batch_job_details.BatchJobDetails
2 changes: 1 addition & 1 deletion docs/batch/batch-job-state.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.batch_job_state.BatchJobState
::: hume._measurement.batch.batch_job_state.BatchJobState
2 changes: 1 addition & 1 deletion docs/batch/batch-job-status.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.batch_job_status.BatchJobStatus
::: hume._measurement.batch.batch_job_status.BatchJobStatus
2 changes: 1 addition & 1 deletion docs/batch/batch-job.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.batch_job.BatchJob
::: hume._measurement.batch.batch_job.BatchJob
2 changes: 1 addition & 1 deletion docs/batch/hume-batch-client.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.hume_batch_client.HumeBatchClient
::: hume._measurement.batch.hume_batch_client.HumeBatchClient
2 changes: 1 addition & 1 deletion docs/batch/transcription-config.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._batch.transcription_config.TranscriptionConfig
::: hume._measurement.batch.transcription_config.TranscriptionConfig
2 changes: 1 addition & 1 deletion docs/stream/hume-stream-client.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._stream.hume_stream_client.HumeStreamClient
::: hume._measurement.stream.hume_stream_client.HumeStreamClient
2 changes: 1 addition & 1 deletion docs/stream/stream-socket.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: hume._stream.stream_socket.StreamSocket
::: hume._measurement.stream.stream_socket.StreamSocket
1 change: 1 addition & 0 deletions docs/voice/hume-voice-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: hume._voice.hume_voice_client.HumeVoiceClient
1 change: 1 addition & 0 deletions docs/voice/microphone-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: hume._voice.microphone.microphone_interface.MicrophoneInterface
1 change: 1 addition & 0 deletions docs/voice/voice-chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: hume._voice.models.chats_models.VoiceChat
1 change: 1 addition & 0 deletions docs/voice/voice-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: hume._voice.models.configs_models.VoiceConfig
1 change: 1 addition & 0 deletions docs/voice/voice-socket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: hume._voice.voice_socket.VoiceSocket
2 changes: 1 addition & 1 deletion hume/_voice/voice_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def send_file(self, filepath: Path) -> None:
filepath (Path): Filepath to the file to send over the socket.
"""
with filepath.open("rb") as f:
segment: AudioSegment = AudioSegment.from_wav(f)
segment: AudioSegment = AudioSegment.from_file(f)
segment = segment.set_frame_rate(self._sample_rate).set_channels(self._num_channels)
audio_bytes = segment.raw_data
await self._protocol.send(audio_bytes)
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ plugins:

nav:
- "Home": index.md
- "Voice Reference":
- "HumeVoiceClient": voice/hume-voice-client.md
- "MicrophoneInterface": voice/microphone-interface.md
- "VoiceChat": voice/voice-chat.md
- "VoiceConfig": voice/voice-config.md
- "VoiceSocket": voice/voice-socket.md
- "Batch Reference":
- "HumeBatchClient": batch/hume-batch-client.md
- "BatchJob": batch/batch-job.md
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def eval_data() -> EvalData:
"burst-amusement-009": f"{base_url}/audio/burst-amusement-009.mp3",
"prosody-horror-1051": f"{base_url}/audio/prosody-horror-1051.mp3",
"prosody-noticias": f"{base_url}/audio/prosody-noticias.mp3",
"know-any-good-jokes": f"{base_url}/audio/know-any-good-jokes.wav",
"know-any-good-jokes": f"{base_url}/audio/know-any-good-jokes.mp3",
"text-happy-place": f"{base_url}/text/happy.txt",
"text-obama-news": f"{base_url}/text/obama.txt",
"three-faces-mediapipe": f"{base_url}/landmarks/three-faces-mediapipe.json",
Expand Down

0 comments on commit f0cdd06

Please sign in to comment.