Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
56aae65b
Commit
56aae65b
authored
Apr 14, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made it a little nicer; use CDDA_DATASIZE; restore output sampling rate
parent
142d2be2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
Demo/sgi/cd/recvcd.py
Demo/sgi/cd/recvcd.py
+24
-13
No files found.
Demo/sgi/cd/recvcd.py
View file @
56aae65b
...
@@ -3,23 +3,34 @@
...
@@ -3,23 +3,34 @@
import
al
,
AL
import
al
,
AL
from
socket
import
*
from
socket
import
*
from
CD
import
CDDA_DATASIZE
PORT
=
50505
# Must match the port in sendcd.py
PORT
=
50505
# Must match the port in sendcd.py
def
main
():
def
main
():
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
s
.
bind
(
''
,
PORT
)
s
.
bind
(
''
,
PORT
)
c
=
al
.
newconfig
()
oldparams
=
[
AL
.
OUTPUT_RATE
,
0
]
c
.
setchannels
(
2
)
params
=
oldparams
[:]
c
.
setwidth
(
2
)
al
.
getparams
(
AL
.
DEFAULT_DEVICE
,
oldparams
)
p
=
al
.
openport
(
'Audio from CD'
,
'w'
,
c
)
params
[
1
]
=
AL
.
RATE_44100
al
.
setparams
(
AL
.
DEFAULT_DEVICE
,
[
AL
.
OUTPUT_RATE
,
AL
.
RATE_44100
])
try
:
al
.
setparams
(
AL
.
DEFAULT_DEVICE
,
params
)
config
=
al
.
newconfig
()
config
.
setwidth
(
AL
.
SAMPLE_16
)
config
.
setchannels
(
AL
.
STEREO
)
port
=
al
.
openport
(
'CD Player'
,
'w'
,
config
)
N
=
2352
while
1
:
while
1
:
data
=
s
.
recv
(
CDDA_DATASIZE
)
data
=
s
.
recv
(
N
)
if
not
data
:
if
not
data
:
print
'EOF'
print
'EOF'
break
break
port
.
writesamps
(
data
)
p
.
writesamps
(
data
)
except
KeyboardInterrupt
:
pass
al
.
setparams
(
AL
.
DEFAULT_DEVICE
,
oldparams
)
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment