MMM-PrayerTime icon indicating copy to clipboard operation
MMM-PrayerTime copied to clipboard

[Feature request] End Adhan playback quickly

Open gragib opened this issue 4 years ago • 9 comments

Is there a quick way to end playback of the Adhan when, for example, a baby is sleeping? Most Adhan clocks have a convenient button for ending playback.

I did not find any obvious way of doing this short of unplugging the speaker or turning the system volume down, so I am asking here.

If none exists, here's my suggestion: Press and hold on the Adhan popup to end playback. I am not sure if this can be implemented with the MagicMirror framework.

gragib avatar Dec 27 '20 03:12 gragib

I also wanted a way to do that, so I added a button to mute the pi computer. it's not very elegant nor does it show on the magic mirror when the system is muted. I like the idea of pressing or maybe swiping to get the notification to stop the adzan, although I do not have a touchscreen.

74Km avatar Dec 28 '20 21:12 74Km

Unfortunately, it does not support the feature you asked currently. But, you can combine with other module solution to create this function. Any PR are welcome.

slametps avatar Dec 29 '20 04:12 slametps

My immediate solution is to use a microcontroller board plugged in to the raspberry Pi and emulate a USB keyboard using CircuitPython. I am using a DPI display that takes up all the GPIO pins.

When you press a button connected to the microcontroller, the Raspberry Pi mutes its audio output for 5 minutes.

The current implementation for playing Adhan uses async to run omxplayer. If instead the lame module from npm was used, we can get play/pause/stop support.

gragib avatar Dec 29 '20 06:12 gragib

Hello, I’m not getting any sound out of my tv through the HDMI connection for the Azdan time. everything else is working fine. Can anyone help me, please?

massi1990 avatar Feb 28 '23 09:02 massi1990

What hardware do you use? PI 3 or 4? How you access MagicMirror? On RPI or remotely? Since MMM-PrayerTime play sound locally (server side), you MUST run MagicMirror on RPI. If you use RPI4, you must select your sound output by setting via raspi-config.

slametps avatar Mar 01 '23 01:03 slametps

I'use PI3,

omxplayer -p -o hdmi /home/pi/azdan.mp3 Audio codec mp3float channels 2 samplerate 44100 bitspersample 32 Subtitle count: 0, state: off, index: 1, delay: 0 have a nice day ;)

But not sound

massi1990 avatar Mar 01 '23 16:03 massi1990

I'use PI3,

omxplayer -p -o hdmi /home/pi/azdan.mp3 Audio codec mp3float channels 2 samplerate 44100 bitspersample 32 Subtitle count: 0, state: off, index: 1, delay: 0 have a nice day ;)

But not sound

Is that execution result on your console? No output sound? You might try -o both option.

slametps avatar Mar 02 '23 04:03 slametps

Same no sound

massi1990 avatar Mar 02 '23 07:03 massi1990

I managed to output the Adhan (call to prayer) through HDMI by modifying the code in "Node_helper.js". I replaced the command : var adzanCmd = '/usr/bin/omxplayer -o both modules/MMM-PrayerTime/res/' + adzanSound + ' &'; with : var adzanCmd = 'cvlc --play-and-exit modules/MMM-PrayerTime/res/' + adzanSound + ' &';

massi1990 avatar Mar 07 '23 09:03 massi1990