react-native-live-audio-stream icon indicating copy to clipboard operation
react-native-live-audio-stream copied to clipboard

example code fail to start

Open Ppang0405 opened this issue 2 years ago • 1 comments

Screenshot_20211112-095627_audioLevel

import LiveAudioStream from 'react-native-live-audio-stream';

const options = {
  sampleRate: 32000,  // default is 44100 but 32000 is adequate for accurate voice recognition
  channels: 1,        // 1 or 2, default 1
  bitsPerSample: 16,  // 8 or 16, default 16
  audioSource: 6,     // android only (see below)
  bufferSize: 4096    // default is 2048
};

LiveAudioStream.init(options);
LiveAudioStream.on('data', data => {
  var chunk = Buffer.from(data, 'base64');
  // base64-encoded audio data chunks
  console.log('DATA', { data, chunk })
});

LiveAudioStream.start();

// LiveAudioStream.stop();

Do the library is dead? I do not see any active maintainer reply any issues?

Ppang0405 avatar Nov 12 '21 03:11 Ppang0405