Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import subprocess
- import sys
- def main():
- audio_url, output_file = sys.argv[1:3]
- popen = subprocess.Popen
- mp3 = popen(('ffmpeg','-i', audio_url,
- '-f','s16le','-ac','1','-ar','16000','pipe:0'),
- stdout=subprocess.PIPE)
- with mp3.stdout as pipe, open(output_file, 'wb') as output:
- sphinx = popen(('java','-jar','transcriber.jar'),
- stdin=pipe, stdout=output)
- sys.exit(sphinx.wait() | mp3.wait())
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement