Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertopasqualetto/soundmeteresp
Simple sound meter Android app created with Jetpack Compose with dynamic theming
https://github.com/albertopasqualetto/soundmeteresp
audio dynamic-colors jetpack-compose kotlin-android mpandroidchart sound-meter
Last synced: 25 days ago
JSON representation
Simple sound meter Android app created with Jetpack Compose with dynamic theming
- Host: GitHub
- URL: https://github.com/albertopasqualetto/soundmeteresp
- Owner: albertopasqualetto
- License: mit
- Created: 2023-03-28T12:47:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T14:08:45.000Z (over 1 year ago)
- Last Synced: 2024-11-10T03:16:49.730Z (3 months ago)
- Topics: audio, dynamic-colors, jetpack-compose, kotlin-android, mpandroidchart, sound-meter
- Language: Kotlin
- Homepage:
- Size: 384 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SoundMeterESP
This is a simple sound meter Android app created for the Embedded Systems Programming course (Computer Engineering) at the University of Padua.
## Description
It uses the internal microphone of the device to measure the sound level in decibels.
The sound level is displayed in a chart and in a text view in "real time", also there is the history of the sound level of the last 5 minutes.
## Technical details
The app is written in Kotlin and uses the [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart) library to display the chart.
The app is based on Jetpack Compose for showing the UI and it follows material3 guidelines and style as much as possible.
Its `targetSdk` is API 31 (Android 12) since my device is running Android 12 (Samsung Galaxy S10) and the `minSdk` is API 26.
It implements the dynamic color theming introduced in Android 12 both in icon and in the app's colors.The app uses a foreground service to keep the microphone active even when the app is in background so that it can keep measuring the sound level.
The dB value presented is not accurate since it is not calibrated with a reference of 0 dB and the `MediaRecorder.AudioSource.MIC` does some elaboration to the audio (`MediaRecorder.AudioSource.UNPROCESSED` is not used since it is not supported on all the devices); but it is enough to see the difference between a quiet and a loud environment.
Some Google's libraries are used to get the screen height on rotation in order to choose the right screen layout ([material3-window-size-class](https://developer.android.com/reference/kotlin/androidx/compose/material3/windowsizeclass/package-summary)) and for asking and managing the permissions at runtime easily in compose ([accompanist-permissions](https://google.github.io/accompanist/permissions/)) which relies on the androidx's APIs.
## Screenshots
Horizontal layout in light mode:
Vertical layout in dark mode: