slametps / MMM-PrayerTime

This an extension for the [MagicMirror](https://github.com/MichMich/MagicMirror). It will display prayer time (in local time).
MIT License
20 stars 10 forks source link

[Feature request] End Adhan playback quickly #45

Open gragib opened 3 years ago

gragib commented 3 years ago

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.

74Km commented 3 years ago

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.

slametps commented 3 years ago

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.

gragib commented 3 years ago

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.

massi1990 commented 1 year ago

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?

slametps commented 1 year ago

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.

massi1990 commented 1 year ago

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

slametps commented 1 year ago

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.

massi1990 commented 1 year ago

Same no sound

massi1990 commented 1 year ago

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 + ' &';