FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gradint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Insights
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
Silas S. Brown
gradint
Commits
00e87b27
Commit
00e87b27
authored
2 years ago
by
Silas S. Brown
Browse files
Options
Downloads
Patches
Plain Diff
player utility
parent
d6d94651
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gradint-build/samples/utils/README.txt
+2
-0
2 additions, 0 deletions
gradint-build/samples/utils/README.txt
gradint-build/samples/utils/player.py
+34
-0
34 additions, 0 deletions
gradint-build/samples/utils/player.py
with
36 additions
and
0 deletions
gradint-build/samples/utils/README.txt
+
2
−
0
View file @
00e87b27
...
...
@@ -50,6 +50,8 @@ online synthesizers (or real people) to the synth cache
transliterate.py - make a transliterated vocab report
(for use with grep or on PDAs or whatever)
player.py - play
diagram.py - make a diagram of a gradint lesson
trace.py - make a raytraced animation of a lesson
This diff is collapsed.
Click to expand it.
gradint-build/samples/utils/player.py
0 → 100644
+
34
−
0
View file @
00e87b27
#!/usr/bin/env python2
# Simple sound-playing server
# Silas S. Brown - public domain - no warranty
# connect to port 8124 (assumes behind firewall)
# and each connection can send WAV or MP3 data
# so gradint advanced.txt can do
# wavPlayer = mp3Player = "nc HostName 8124 -q 0 <"
import
socket
,
os
os
.
environ
[
"
PATH
"
]
+=
"
:/usr/local/bin
"
s
=
socket
.
socket
()
s
.
bind
((
''
,
8124
))
s
.
listen
(
5
)
while
True
:
c
,
a
=
s
.
accept
()
d
=
c
.
recv
(
4
)
if
d
==
'
RIFF
'
:
player
=
"
play - 2>/dev/null
"
# WAV
elif
d
==
'
STOP
'
:
c
.
close
()
while
not
d
==
'
START
'
:
c
,
a
=
s
.
accept
()
;
d
=
c
.
recv
(
5
)
;
c
.
close
()
continue
else
:
player
=
"
mpg123 - 2>/dev/null
"
# MP3
player
=
os
.
popen
(
player
,
"
w
"
)
while
d
:
try
:
player
.
write
(
d
)
except
IOError
:
break
# it was probably killed
d
=
c
.
recv
(
4096
)
try
:
c
.
close
()
;
player
.
close
()
except
:
pass
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