Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Speech To Speech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
huggingface
Speech To Speech
Commits
4909824b
Commit
4909824b
authored
6 months ago
by
Andres Marafioti
Browse files
Options
Downloads
Patches
Plain Diff
add logging to the local audio streamer
parent
a6f27a28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
connections/local_audio_streamer.py
+5
-0
5 additions, 0 deletions
connections/local_audio_streamer.py
with
5 additions
and
0 deletions
connections/local_audio_streamer.py
+
5
−
0
View file @
4909824b
...
...
@@ -3,7 +3,9 @@ import sounddevice as sd
import
numpy
as
np
import
time
import
logging
logger
=
logging
.
getLogger
(
__name__
)
class
LocalAudioStreamer
:
def
__init__
(
...
...
@@ -26,6 +28,8 @@ class LocalAudioStreamer:
else
:
outdata
[:]
=
self
.
output_queue
.
get
()[:,
np
.
newaxis
]
logger
.
debug
(
"
Available devices:
"
)
logger
.
debug
(
sd
.
query_devices
())
with
sd
.
Stream
(
samplerate
=
16000
,
dtype
=
"
int16
"
,
...
...
@@ -33,6 +37,7 @@ class LocalAudioStreamer:
callback
=
callback
,
blocksize
=
self
.
list_play_chunk_size
,
):
logger
.
info
(
"
Starting local audio stream
"
)
while
not
self
.
stop_event
.
is_set
():
time
.
sleep
(
0.001
)
print
(
"
Stopping recording
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment