skip to Main Content

In flutter I am not able to play uint8List type as audio when streaming via websocket with just_audio package

Here is my code : try { _channel = IOWebSocketChannel.connect( 'wss://api.elevenlabs.io/v1/text-to-speech/$voiceId/stream-input?model_id=$model'); _channel!.stream.listen( (data) async { final response = jsonDecode(data); if (response['audio'] != null) { try{ final audioChunk = response['audio'] as String; final uint8List = Uint8List.fromList(base64.decode(audioChunk)); await _audioPlayer.setAudioSource( ConcatenatingAudioSource( children: […

VIEW QUESTION

Firebase – How to stream data to the Browser with Google Cloud Functions so that download starts immediately?

I am streaming data to the browser like this: res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Content-Disposition': 'attachment; filename="data.dat"', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' }) stream1.pipe(res, {end: false)}; stream1.on('end', () => { console.log("stream 1 finished"); stream2.pipe(res, {end: false}); stream2.on('end', () => { console.log("last stream…

VIEW QUESTION
Back To Top
Search