Streaming audio on Flutter with websocket not working as expected
So I am opening a websocket connection with elevenlabs api like this and fetching stream of audio data : final socketChannel = IOWebSocketChannel.connect( ‘wss://api.elevenlabs.io/v1/text-to-speech/${widget.voiceId}/stream-input?model_id=$model’); final AudioPlayer audioPlayer = AudioPlayer(); final streamController = StreamController<List<int>>(); final myCustomSource = MyCustomSource(streamController.stream); final bosMessage = { “text”: ” “, “voice_settings”: {“stability”: 0.5, “similarity_boost”: true}, “xi_api_key”: “api_key”, }; socketChannel.sink.add(jsonEncode(bosMessage)); socketChannel.stream.listen((message) async … Read more