Open iamklim opened 6 months ago
Hello! Can I use SwiftAudioPlayer with ElevenLabs Text to Speech Stream API request?
I understand how to stream audio with GET request acc. to docs:
let url = URL(string: "https://randomwebsite.com/audio.mp3")! SAPlayer.shared.startRemoteAudio(withRemoteUrl: url) SAPlayer.shared.play()
But what if I need also to attach payload to POST request like
var request = URLRequest(url: url) request.httpMethod = "POST" let payload: [String: Any] = [ "text": "Hello", "model_id": "eleven_multilingual_v2", "voice_settings": [ "stability": 0.5, "similarity_boost": 0.75, ] ] let jsonData = try? JSONSerialization.data(withJSONObject: payload, options: .fragmentsAllowed) request.httpBody = jsonData
Response returns audio as an audio stream. Is it possible somehow?
@iamklim did you find a way to get streaming audio from elevenlabs to work in Swift? I'm trying to do the seame thing.
@iamklim @mgerstenblatt I am trying to figure out the same thing! Any tips?
Hello! Can I use SwiftAudioPlayer with ElevenLabs Text to Speech Stream API request?
I understand how to stream audio with GET request acc. to docs:
But what if I need also to attach payload to POST request like
Response returns audio as an audio stream. Is it possible somehow?