bug: disable sound does not disable the alarm sound. #178

Closed
opened 2023-11-11 03:13:16 +00:00 by nutpants · 8 comments

disable sound does not disable the alarm sound.
at least it still played in my wireless earbuds in v1.167 for me.

disable sound does not disable the alarm sound. at least it still played in my wireless earbuds in v1.167 for me.
brandon.presley added the
bug
label 2023-11-11 22:17:15 +00:00

Are you doing it with a custom sound file or just the default?

Are you doing it with a custom sound file or just the default?

Ignore above question I couldn't replicate this issue with a custom sound and with the default sound. Not sure how this is happening since the logic only really depends on the settings and doesn't mention the audio output at all:

    private fun playSound(settings: Settings) {
        if (settings.sound == null && !settings.noSound) {
            mediaPlayer = MediaPlayer.create(applicationContext, R.raw.argon)
            mediaPlayer?.start()
            mediaPlayer?.setOnCompletionListener { vibrator?.cancel() }
        } else if (settings.sound != null && !settings.noSound) {
            mediaPlayer = MediaPlayer().apply {
                setAudioAttributes(
                    AudioAttributes.Builder()
                        .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
                        .setUsage(AudioAttributes.USAGE_MEDIA)
                        .build()
                )
                setDataSource(applicationContext, Uri.parse(settings.sound))
                prepare()
                start()
                setOnCompletionListener { vibrator?.cancel() }
            }
        }
    }


Ignore above question I couldn't replicate this issue with a custom sound and with the default sound. Not sure how this is happening since the logic only really depends on the settings and doesn't mention the audio output at all: ```kotlin private fun playSound(settings: Settings) { if (settings.sound == null && !settings.noSound) { mediaPlayer = MediaPlayer.create(applicationContext, R.raw.argon) mediaPlayer?.start() mediaPlayer?.setOnCompletionListener { vibrator?.cancel() } } else if (settings.sound != null && !settings.noSound) { mediaPlayer = MediaPlayer().apply { setAudioAttributes( AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .setUsage(AudioAttributes.USAGE_MEDIA) .build() ) setDataSource(applicationContext, Uri.parse(settings.sound)) prepare() start() setOnCompletionListener { vibrator?.cancel() } } } } ```
Author

it was set to the default sound ( i never even looked at the setting). but it defiantly did play the sound for the alarm while disable sound was set
it was only over bluetooth as that was the only way i used the app at the time
i just tested it again v1.173 and a alarm played sound ( defaut i guess) with a pop up notification that the timer alarm ended

it was set to the default sound ( i never even looked at the setting). but it defiantly did play the sound for the alarm while disable sound was set it was only over bluetooth as that was the only way i used the app at the time i just tested it again v1.173 and a alarm played sound ( defaut i guess) with a pop up notification that the timer alarm ended

I'll leave this ticket open but it's unlikely I will be able to fix it, since I can't recreate the issue myself. If someone else wants to figure it out and push a pull request I'll review and merge it.

I'll leave this ticket open but it's unlikely I will be able to fix it, since I can't recreate the issue myself. If someone else wants to figure it out and push a pull request I'll review and merge it.
Author

tested the latest 1.18 on android 9 and android 12 both play the alarm sound on the device with disable sound checked.
defaut setting nothing touched with a fresh install just one exercise created and run.

maybe just add a volume control for the alarm sound? if there is no other way
i could just create an 1 second silent mp3 and use that as my alarm sound also i guess.

tested the latest 1.18 on android 9 and android 12 both play the alarm sound on the device with disable sound checked. defaut setting nothing touched with a fresh install just one exercise created and run. maybe just add a volume control for the alarm sound? if there is no other way i could just create an 1 second silent mp3 and use that as my alarm sound also i guess.

I saw some dev blog for android saying not to do volume control for a specific program. Said something about how it overrides the system volume I think? Would be easy enough to add though, i'll think about it

I saw some dev blog for android saying not to do volume control for a specific program. Said something about how it overrides the system volume I think? Would be easy enough to add though, i'll think about it
Author

maybe change the alarm sound to a 0 byte alarm sound as default with the silent switch might be easy also.

maybe change the alarm sound to a 0 byte alarm sound as default with the silent switch might be easy also.

Will try this

Will try this
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: brandon.presley/Massive#178
No description provided.