Posts

Showing posts with the label audio

How can I detect if another app is playing music?

25 4 The bounty expires tomorrow . Answers to this question are eligible for a +500 reputation bounty. grapefrukt wants to draw more attention to this question: From my own reading of the documentation, I don't think this is possible today, but I'd love to be proven wrong. I'm making a game and I would like to detect if something else is already playing music (or starts to play music) as...

Sound metering react-native

Im building a react-native application. Im trying to meter the current sound level (in decibel). Libraries in use: react-native-audio and react-native-sound. There is anybody familiar with this feature? Thank you. You can use react-native-audio currentMetering value - in order to get the sound level in real-time. First, you will have to initialise your recorder (which i will assume youve done). I use prepareRecordingAtPath in a similar way to below AudioRecorder.prepareRecordingAtPath(audioPath, { SampleRate: 22050, Channels: 1, AudioQuality: "Low", AudioEncoding: "aac", MeteringEnabled: true }); then once you've called AudioRecorder.startRecording(); (Note you have access to .pause() and .stop() methods also Now for handling the audio level, you are going to have to retrieve the data that is returned by the onProgress method. From what i remember, there should be some currentMetering value that you can access. Note t...