#!/bin/ksh
# beep.sh
# *********************************************************
# Generate a 1 second sinewave, beep WAVE file using ADE for the AMIGA.
# Original design (C)2015, B.Walker, G0LCU.
# Issued as Public Domain, CC0. You may do with it as you please.
# *********************************************************
# Data required for sinewave generation.
data="\\x80\\x26\\x00\\x26\\x7F\\xD9\\xFF\\xD9"
# Create the file /home/sinewave.wav WAVE header only, mono, 8 bit depth unsigned, 8000Hz sample rate.
printf "\x52\x49\x46\x46\x24\x20\x00\x00\x57\x41\x56\x45\x66\x6D\x74\x20\x10\x00\x00\x00\x01\x00\x01\x00\x40\x1F\x00\x00\x40\x1F\x00\x00\x01\x00\x08\x00\x64\x61\x74\x61\x40\x1F\x00\x00" > /home/sinewave.wav
# Now create the 8192 byte approximately 1 second 1KHz burst.
for sinewave in $( seq 0 1 9 )
do
        data=$data$data
done
# Append this data to the WAVE header and you have a universal !HKz sinewave beep that can be played on almost any device.
printf "$data" >> /home/sinewave.wav
exit 0
# The first of a few simple pieces of code for the ADE suite for the AMIGA.