Open VincentLu91 opened 2 years ago
ScreenAudioRecorder.on('data', data => {
Are you sure the global.socket is not null? Did you try putting a log right after "ScreenAudioRecorder.on('data', date => {" to see if something is returned?
nothing's returned. First I was prompted to allow casting/recording and I confirmed yes. But the console.log doesn't run.
Try somenting like this:
...
ScreenAudioRecorder.on('data', data => {
console.log(data);
if (global.socket) {
global.socket.send(JSON.stringify({audio_data: data}));
}
})
global.socket.onopen = () => {
console.log('start');
ScreenAudioRecorder.start();
}
...
Still nothing
Hi @Nilsantos . Any other suggestions or ideas?
This library doesn't work? Been trying it for a few hours now.
(EDIT) I tried the demo and it works just fine! I just need to figure out how I'm using it wrong! 🍔
@niembro64 yes, the library works. Could you share the error that appeared? I'm not updating this library anymore, but I'll try to fix the problems.
Hi @Nilsantos how exactly are you accomplishing this? Which android MediaRecorder.AudioSource are you using when it's not recording from the mic? REMOTE_SUBMIX seems to be what's needed but it seems to require special permissions?
https://developer.android.com/reference/android/media/MediaRecorder.AudioSource
I'm making an app that's heavily dependent on this stuff so any insight is helpful!
@niembro64, you can see the android source code here https://github.com/Nilsantos/react-native-screen-audio-recorder/tree/master/android/src/main/java/com/reactnativescreenaudiorecorder.
But is an error appearing when you try to use the library in react native? If you can share what's going on maybe I can fix it
@Nilsantos I appreciate the responses.
To be clear, I have tried your demo app and it works as intended!
I am curious how this is getting accomplished i.e. which audio source number you are using in android for capturing audio output from the phone?
Here's a snapshot of your Java code:
I see you are using VOICE_RECOGNITION (6) when fromMic but I can't understand what audio source is being used when not fromMic?
@Nilsantos I realized what my issue is -> I'm using two libraries that both us the same parent library / underlying java methods.
Some issues noticed when using together:
Appreciate any insight you might have! Eric
Tried:
I installed and imported the library in my InternalAudio component. However, I set up a ScreenAudioRecorder and it doesn't return any audio data from videos that I play on the device.
Code:
Android version is version 10 on my device.
React Native version is 0.63.