任何人都使用Nexmo语音API为活动呼叫创建Stream音频文件 https://developer.nexmo.com/api/voice#stream-an-audio-file-to-an-active-call
使用php或ruby或任何其他语言的任何示例源代码?
感谢。
答案 0 :(得分:0)
为什么不看看红宝石宝石?
答案 1 :(得分:0)
Nexmo Ruby gem的自述文件包含streaming audio to a call.
的代码示例require 'nexmo'
client = Nexmo::Client.new(api_key: 'YOUR-API-KEY', api_secret: 'YOUR-API-SECRET')
response = client.calls.create({
to: [{type: 'phone', number: 'TO-NUMBER'}],
from: {type: 'phone', number: 'FROM-NUMBER'},
answer_url: ['https://example.com/answer']
})
stream_url = 'https://nexmo-community.github.io/ncco-examples/assets/voice_api_audio_streaming.mp3'
response = client.stream.start("CALL-UUID", stream_url: stream_url)