For help on how to use an App Inventor extension, please see this extensions guide.
You can download the sound pressure level extension here.
This extension measures the sound pressure level and returns the data in decibels. There are three different measurements reported, unweighted decibels (dB), A-Weighted decibels (dBA), and C-Weighted decibels (dBC). With this data you can build applications that measure and display sound around the device, or even to use the sound level as a way to control some other component of the application!
Notes:
There are some accuracy issues across devices. Different devices will have different microphones with different sensitivity levels, causing measurements to vary from device to device.
This extension requires permission to record audio in order to be able listen to the noise of the surrounding environment. This permission can be granted while running or before starting the application.
Indicates whether or not there is a microphone available to measure sound pressure.
Indicates whether or not the microphone is measuring sound pressure.
Sets the sensor’s Enabled
flag to true
to turn the extension on and false
to turn the extension off.
Gets the sound pressure level data in decibels (dB). The measurement reported by this call is unweighted.
Sets the listening interval in milliseconds for how fast should the SPL return a reading.
Gets the listening interval in milliseconds.
This event is triggered when the sound pressure level is updated.
This event gives access to the sound intensity over the last ListenIntervalMilliseconds
amount of time in decibels (dB), A-Weighted decibels (dBA), C-Weighted decibels (dBC).
You can use a minimal App Inventor application or a more in-depth example App Inventor application to see the sound pressure level extension in action.
More in-depth information for developers can be found here.
This extension was originally created by Nathan Oesterle (lead developer), Guilherme Lopes Dias, George Colgrove, and Ryan Connors