gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

iOS: Alarm volume does not fade #267

Open orkun1675 opened 4 weeks ago

orkun1675 commented 4 weeks ago

Alarm plugin version 4.0.7

Describe the bug Instead of slowly fading to full volume, the alarm starts ringing at the full volume.

To Reproduce

  1. We use an audio file that is silent for 5 seconds and loud for 30+ seconds
  2. When creating alarm set the following parameters:
loopAudio: true,
vibrate: true,
volume: 0.8,
fadeDuration: 12, // seconds
  1. Wait for alarm to ring
  2. Observe how the volume is already at 80% at the 5 second mark

Expected behavior The volum should increase linearly over 12 seconds. So we would expect to hear 5/12*0.8 = 33% volume alarm at the 5 second mark.

Screenshots N/A

Device info iPhone SE, iOS 18.0.1, physical device

Additional context Note that this is WAI on Android.

gdelataillade commented 3 weeks ago

I’ve just released version 4.0.8 with a fix. Please let me know if it resolves the issue. Thanks!

orkun1675 commented 3 weeks ago

Even with a fade duration of 30 seconds I wasn't able to verify this is working, it still feels like the volume is constant.

gdelataillade commented 3 weeks ago

Are you sure the volume is constant ? If you want you can build the app with Xcode, you will see more logs like this:

CleanShot 2024-10-29 at 16 34 18@2x

If you want to check out the code, take a look at the SwiftAlarmPlugin.fadeVolume method.