Repository navigation
Silly script: BBC world service streaming text #185
Copy link
Copy link
Closed
Labels
ideasInteresting ideas for experimentationInteresting ideas for experimentation
Description
Thanks for the code! This is great!
This script will:
- grab 30s of audio from bbc radio
- transcribe it
- spit out transcribed text
- 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--
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ideasInteresting ideas for experimentationInteresting ideas for experimentation
Activity
livestream.sh : simple tool to transcribe audio livestreams (#185)
ggerganov commentedon Nov 26, 2022
@semiformal-net
Great idea :) I think this is exactly what @abelbabel was looking for in #65 (comment)
I added the livestream.sh script to the repo. It is based on your idea above.
For example:
There is a problem that across sequential
ffmpegruns, we loose a bit of audio so some of the words are missing.Not sure how to fix this. Probably there is some
ffmpegto solve this.semiformal-net commentedon Nov 26, 2022
@ggerganov glad I could help!
I noticed the loss of audio between snapshots as well... I'll play around with ffmpeg and see if I can figure out a patch.
abelbabel commentedon Nov 26, 2022
In the result it may become what I was looking for, but I would consider this a workaround ... to me it seems kind of breaking how one expects unix-programs usually work - when getting data via pipe, process it ...
Maybe the approach might be to adapt the stream example and generalize it (where one example/specific use case is reading from mic-device and another might be reading from pipe ...) ... in fact it should make no difference, if input to the command is a mic or an ffmpeg-stream or whatever, as long as it has the wav-format
ggerganov commentedon Nov 27, 2022
@abelbabel
You can actually already achieve something very similar to what you describe:
streamexample using the--capture Nargument, whereNis the id of the loopback capture deviceffplay,vlc, etc) - thestreamapp will capture it through the loopback device and transcribe it as if it was pipedsemiformal-net commentedon Nov 27, 2022
I created PR #195 that is a bit better. It seems to eliminate the lost words between clips with new logic
ggerganov commentedon Dec 4, 2022
Continued in #209
livestream.sh : simple tool to transcribe audio livestreams (ggml-org…
livestream.sh : simple tool to transcribe audio livestreams (ggml-org…