Преглед изворни кода

Use ramfs to record audio

tags/1.5
Nico Rey пре 4 година
родитељ
комит
ca0dbdcab4
3 измењених фајлова са 9 додато и 13 уклоњено
  1. +2
    -2
      common.sh
  2. +4
    -4
      receive.sh
  3. +3
    -7
      receive_meteor.sh

+ 2
- 2
common.sh Прегледај датотеку

@@ -45,8 +45,8 @@ if [ ! -d "${METEOR_OUTPUT}/audio/" ]; then
mkdir -m 775 -p "${METEOR_OUTPUT}/audio/"
fi

if [ ! -d "${NOAA_AUDIO}/audio/" ]; then
mkdir -m 775 -p "${NOAA_AUDIO}/audio/"
if [ ! -d "${RAMFS_AUDIO}/audio/" ]; then
mkdir -m 775 -p "${RAMFS_AUDIO}/audio/"
fi

if [ ! -d "${NOAA_OUTPUT}/image/" ]; then


+ 4
- 4
receive.sh Прегледај датотеку

@@ -26,7 +26,7 @@ fi
# $7 = Satellite max elevation

log "Starting rtl_fm record" "INFO"
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r 60000 - "${NOAA_AUDIO}/audio/${3}.wav" rate 11025
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r 60000 - "${RAMFS_AUDIO}/audio/${3}.wav" rate 11025

if [ ! -d "{NOAA_OUTPUT}/image/${FOLDER_DATE}" ]; then
mkdir -m 775 -p "${NOAA_OUTPUT}/image/${FOLDER_DATE}"
@@ -44,7 +44,7 @@ log "Bulding pass map" "INFO"
/usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" "${NOAA_HOME}/map/${3}-map.png"
for i in $ENHANCEMENTS; do
log "Decoding image" "INFO"
/usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${NOAA_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/image/${3}-$i.jpg"
/usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/image/${3}-$i.jpg"
/usr/bin/convert -quality 90 -format jpg "${NOAA_OUTPUT}/image/${3}-$i.jpg" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" "${NOAA_OUTPUT}/image/${3}-$i.jpg"
/usr/bin/convert -thumbnail 300 "${NOAA_OUTPUT}/image/${3}-$i.jpg" "${NOAA_OUTPUT}/image/thumb/${3}-$i.jpg
done
@@ -61,8 +61,8 @@ fi

if [ "$DELETE_AUDIO" = true ]; then
log "Deleting audio files" "INFO"
rm "${NOAA_AUDIO}/audio/${3}.wav"
rm "${RAMFS_AUDIO}/audio/${3}.wav"
else
log "Moving audio files out of the SD card" "INFO"
mv "${NOAA_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/audio/${3}.wav"
mv "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/audio/${3}.wav"
fi

+ 3
- 7
receive_meteor.sh Прегледај датотеку

@@ -29,18 +29,14 @@ fi
# $7 = Satellite max elevation

log "Starting rtl_fm record" "INFO"
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M raw -f "${2}"M -s 288k -g 48 -p 1 | sox -t raw -r 288k -c 2 -b 16 -e s - -t wav "${METEOR_OUTPUT}/audio/${3}.wav" rate 96k

log "Normalization in progress" "INFO"
sox "${METEOR_OUTPUT}/audio/${3}.wav" "${METEOR_OUTPUT}/${3}.wav" gain -n
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M raw -f "${2}"M -s 288k -g 48 -p 1 | sox -t raw -r 288k -c 2 -b 16 -e s - -t wav "${RAMFS_AUDIO}/audio/${3}.wav" rate 96k

log "Demodulation in progress (QPSK)" "INFO"
meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}.wav"
meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${RAMFS_AUDIO}/audio/${3}.wav"

if [ "$DELETE_AUDIO" = true ]; then
log "Deleting audio files" "INFO"
rm "${METEOR_OUTPUT}/audio/${3}.wav"
rm "${METEOR_OUTPUT}/${3}.wav"
rm "${RAMFS_AUDIO}/audio/${3}.wav"
fi

log "Decoding in progress (QPSK to BMP)" "INFO"


Loading…
Откажи
Сачувај