Skip to content

Instantly share code, notes, and snippets.

@desimmons
Last active July 27, 2023 14:16
Show Gist options
  • Save desimmons/4d380ff4af07ba8355085dd337fb9c1d to your computer and use it in GitHub Desktop.
Save desimmons/4d380ff4af07ba8355085dd337fb9c1d to your computer and use it in GitHub Desktop.
On demand, subscription free speech-to-text
# Create a payment claim to fund the request
PAYMENT_CLAIM=\
'{"account": "rBUJ2LwrP7XCZhBcnF4FYALLTETKRjcoQU", "destination_account": "rstbSTpPcyxMsiXwkBxS9tFTrg2JsDNxWk", "authorized_to_claim": "100000000", "signature": "6CF8B43A662395AC0FB10057BEFA23723F9A4E417DE08E2D2168C09C897F0D87C36D5EFC03ABF27318AB8C21FB3C042F50A60445689F9C9315022BCF0B363E04", "channel_id": "83A442BBE19F98402087287A63271E0621B2B470DD96FCAF48411220F6328810"}'
# /run end-point for https://dhali-app.web.app/#/assets/d82952124-c156-4b16-963c-9bc8b2509b2c
URL=\
'https://dhali-prod-run-dauenf0n.uc.gateway.dev/d82952124-c156-4b16-963c-9bc8b2509b2c/run'
WAV_FILE=\
'/tmp/tmp.wav'
# An example speech .wav file
wget https://www.signalogic.com/melp/EngSamples/eng_m9.wav -O $WAV_FILE
# Make request to Dhali asset
curl -X PUT \
-H "Payment-Claim: $PAYMENT_CLAIM" \
-F "input=@$WAV_FILE" \
$URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment