Android Question Noise detector by microphone

Lakhtin_V

Active Member
Licensed User
Longtime User
I want to make a noise detector. I need to periodically read the signal level from the microphone. Sound recording using the WAV MP3 standards is not important. It is not important for me to know what the microphone hears, the main thing is the noise level (sound volume). How can such a problem be solved?
 

Lakhtin_V

Active Member
Licensed User
Longtime User
Have you checked that the recorded data in short after byteconverter is correct?...
I abandoned the moderator, analyzed each event and registered only with a large level. Short impulses began to register without problems, everything works as it should. Huge thank you for your help. For persistence of work, use SDK 30 at least
 
Upvote 0

kimstudio

Active Member
Licensed User
Longtime User
If recording audio on Android using LittleEndian and open it on Windows then it should be correct as Windows is LittleEndian. However the Android is BigEndian so the following processing after byteconverter with littleendian = true is questionable.

Then I checked the Android SDK doc and it says:
  • ENCODING_PCM_16BIT: The audio sample is a 16 bit signed integer typically stored as a Java short in a short array, but when the short is stored in a ByteBuffer, it is native endian (as compared to the default Java big endian). The short has full range from [-32768, 32767], and is sometimes interpreted as fixed point Q.15 data.
So the conclusion is setting ByteConverter.LittleEndian = true is correct when using AudioStreamer.

I usually use AudioRecord lib by steve which has readshort func so no this question before. Glad to figure it out.
 
Upvote 0
Top