Skip to content

Commit

Permalink
Fix audio and video timing
Browse files Browse the repository at this point in the history
  • Loading branch information
ghyde committed Apr 9, 2018
1 parent 00edc2f commit c01d403
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.swp
unused/*
6 changes: 3 additions & 3 deletions roll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if has? afplay; then
afplay /tmp/roll.s16 &
elif has? aplay; then
# On Linux, if |aplay| available, stream raw sound.
obtainium $audio_raw | aplay -Dplug:default -q -f S16_LE -r 8000 &
obtainium $audio_raw | aplay -Dplug:default -q -f S16_LE -r 16000 &
elif has? play; then
# On Cygwin, if |play| is available (via sox), pre-fetch compressed audio.
obtainium $audio_gsm >/tmp/roll.gsm.wav
Expand All @@ -77,12 +77,12 @@ audpid=$!
python <(cat <<EOF
import sys
import time
fps = 25; time_per_frame = 1.0 / fps
fps = 30; time_per_frame = 1.0 / fps
buf = ''; frame = 0; next_frame = 0
begin = time.time()
try:
for i, line in enumerate(sys.stdin):
if i % 32 == 0:
if i % fps == 0:
frame += 1
sys.stdout.write(buf); buf = ''
elapsed = time.time() - begin
Expand Down

0 comments on commit c01d403

Please sign in to comment.