gst-vocoder.sh: use alsamidisrc and adjust the comment accordingly
[experiments/gstreamer.git] / shell / create_test_files.sh
1 #!/bin/sh
2
3 set -e
4 set -x
5
6 SECONDS=4
7
8 VIDEO_FRAMERATE=25
9 VIDEO_BUFFERS=$(($VIDEO_FRAMERATE * $SECONDS))
10
11 AUDIO_SAMPLERATE=48000
12 AUDIO_SAMPLESPERBUFFER=1024
13 AUDIO_BUFFERS=$(($AUDIO_SAMPLERATE * $SECONDS / $AUDIO_SAMPLESPERBUFFER))
14
15 create_sample() {
16   FREQ="$1"
17   rm -f "sample_${FREQ}hz.webm"
18   gst-launch-1.0 -e \
19     webmmux name=mux ! filesink location="sample_${FREQ}hz.webm" \
20     videotestsrc pattern=black num-buffers="$VIDEO_BUFFERS" ! video/x-raw,framerate="$VIDEO_FRAMERATE/1" ! \
21         textoverlay valignment=center halignment=center font-desc="Mono, 72" text="${FREQ}Hz" ! \
22         queue ! vp9enc ! mux. \
23     audiotestsrc samplesperbuffer="$AUDIO_SAMPLESPERBUFFER" num-buffers="$AUDIO_BUFFERS" freq="$FREQ" ! audio/x-raw,rate="$AUDIO_SAMPLERATE" ! \
24         queue ! audioconvert ! vorbisenc quality=0.5 ! queue ! mux.
25 }
26
27 create_sample 440
28 create_sample 880