whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

Silly script: BBC world service streaming text

Open semiformal-net opened this issue 1 year ago • 5 comments

Thanks for the code! This is great!

This script will:

  1. grab 30s of audio from bbc radio
  2. transcribe it
  3. spit out transcribed text
  4. repeat

bbc_blaster.sh

#!/bin/bash
for i in $(seq 0 5); do
    ffmpeg -y -i "http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/ak/bbc_world_service.m3u8" -ar 16000 -ac 1 -c:a pcm_s16le -t 30s /tmp/bbcws0.wav > /dev/null 2> /tmp/radioerr &
    PID=( $PID $! )
    wait
    mv /tmp/bbcws0.wav /tmp/bbcws.wav
    ./main -t 8 -m ./models/ggml-base.en.bin -f /tmp/bbcws.wav --no-timestamps -otxt > /dev/null 2> /tmp/whispererr &
    cat /tmp/bbcws.wav.txt
    echo
done

Which looks like this...

$ ./bbc_blaster.sh 
 - Something special about the Crescent crane, you weren't supposed to play with the eat or harm eat. Then when you go to school, you learn about the national symbols and understand the importance. People tend to, for instance, name their businesses after eat, schools, shops, hospitals. The national football team, for instance, the national netball team are all named after the crane. - So you were taught about the Crescent crane
 would. So you would see them practically everywhere. But their population is in decline. Tell us why. The population is in decline because especially in southwestern Uganda, which is largely a very, very green mountainous area. It also tended to have a lot of wetland or swampland areas. And these birds breed in swampland areas. They find food in low-lying valleys. As the population has continued to grow.
 green, mountainous area. It also tended to have a lot of wetland or swampland areas. And these birds breed in swampland areas. They find food in low-lying valleys. As the population has continued to grow all across the country, of course, but more particularly in southwestern Uganda, there has been degradation of the environment. People are looking for more and more land where to settle, more and more land where to grow.
 in low-lying valleys, as the population has continued to grow all across the country, of course, but more particularly in southwestern Uganda, there has been degradation of the environment. People are looking for more and more land where to settle, more and more land where to grow food. And as such, they drain swampland because they have water underneath. The farms do really well, of course, then that means that they are destroying.
 are looking for more and more land where to settle, more and more land where to grow food. And as such, they drain swampland because they have water underneath. The farms do really well. Of course, then that means that they are destroying the habitat of these birds. And patients, you went to Southwest Uganda to meet a man who is actually trying to save these iconic birds. Tell us about him. His name is Jimmy Muhozim.
 - It is well, of course, then that means that they are destroying the habitat of these birds. - And patients, you went to Southwest Uganda to meet a man who is actually trying to save these iconic birds. Tell us about him. - His name is Jimmy Mujozi Muhebua. He's an environmental scientist and he works for an organization called Nature Uganda. So what they are trying to do is work with local communities and try and give--

semiformal-net avatar Nov 26 '22 03:11 semiformal-net