From ded94daf438c52c9b40c5cd71cb7578a58465e38 Mon Sep 17 00:00:00 2001
From: Philippe PITTOLI
Date: Fri, 20 Jan 2017 00:14:45 +0100
Subject: [PATCH] test audio via ffmpeg
---
drop/ainput | 13 +++++++++++++
drop/aoutput | 13 +++++++++++++
pong/app/pingpong.sh | 41 -----------------------------------------
3 files changed, 26 insertions(+), 41 deletions(-)
create mode 100755 drop/ainput
create mode 100755 drop/aoutput
delete mode 100755 pong/app/pingpong.sh
diff --git a/drop/ainput b/drop/ainput
new file mode 100755
index 0000000..29c0f60
--- /dev/null
+++ b/drop/ainput
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+PARAMS="-ac 2 -ar 44000 -f s16le -acodec pcm_mulaw"
+
+if [ $# != 1 ]
+then
+ echo "usage: $0 music-file" 1>&2
+ exit 1
+fi
+
+FILE="$1"
+
+ffmpeg -loglevel 0 -i ${FILE} ${PARAMS} -
diff --git a/drop/aoutput b/drop/aoutput
new file mode 100755
index 0000000..c57de72
--- /dev/null
+++ b/drop/aoutput
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+PARAMS="-ac 2 -ar 44000 -f s16le -acodec pcm_mulaw"
+
+if [ $# != 1 ]
+then
+ echo "usage: $0 music-file" 1>&2
+ exit 1
+fi
+
+FILE="$1"
+
+ffmpeg ${PARAMS} -i - ${FILE}
diff --git a/pong/app/pingpong.sh b/pong/app/pingpong.sh
deleted file mode 100755
index c086c75..0000000
--- a/pong/app/pingpong.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/dash
-
-REP=/tmp/ipc/
-SERVICE="pongd"
-NB=10
-# CLEAN UP !
-if [ $# -ne 0 ] && [ "$1" = clean ]
-then
- echo "clean rep ${REP}"
- rm ${REP}/${SERVICE} 2>/dev/null
- rm ${REP}/*-in 2>/dev/null
- rm ${REP}/*-out 2>/dev/null
-
- exit 0
-fi
-
-if [ $# -ne 0 ]
-then
- NB=$1
-fi
-
-for pid in `seq 1 ${NB}`
-do
- # pid index version
- echo "${pid} 1 1" | nc -U ${REP}${SERVICE}
-
- # the purpose is to send something in the pipe
- echo "hello frero" | nc -U ${REP}${pid}-1-1
- #echo "exit" | nc -U ${REP}${pid}-1-1
-
- # the service will answer with our message
- echo "pid : ${pid}"
- #cat ${REP}/${pid}-1-1-in
-
-done
-
-echo "exit" | nc -U ${REP}${SERVICE}
-
-echo "clean rep"
-#rm ${REP}/*
-#rm ${REP}/*-out