Created
October 27, 2017 13:30
-
-
Save machisuji/ed561ee40f1ad19cf6d7e1e92342daba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AudioController | |
def playback | |
ssml = SSMD.to_ssml params.require(:ssmd) | |
result = Audio::Polly.say ssml, ssml: true, language: params[:language] | |
if result | |
send_data result.audio_stream.read, type: "audio/ogg", disposition: "inline" | |
else | |
render json: { errors: ["invalid SSML"] }, status: 400 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment