Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29428

react-native passing ArrayBuffer or Uint16Array to native ReadableArray on Android

$
0
0

I'm receiving a PCM buffer from websocket onmessage method as result

    console.log('cleblanc length of TTS data ' + result.byteLength);
    const buff = new Uint16Array(result);
    console.log('cleblanc TTS data ' + buff);
    RNTtsPlayer.playTts(buff);

and my native method

  @ReactMethod
  public void playTts(ReadableArray readableArray)

It's causing Malformed calls from JS: field sizes are different

I'd like to pass the data as a ReadableArray, but when I try using ReadableMap and passing result directly it results in the Java layer receiving an empty map. Should I try converting it to a String or is there a way to make this work.


Viewing all articles
Browse latest Browse all 29428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>