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

Add adzan-voice feature.. #12

Closed theramez closed 4 years ago

theramez commented 5 years ago

Not an issue but a feature request

Add ability to select the azan sound from various voices (like Al-minshawy adzan, Abdul-Basit adzan, Mekka adzan...etc) I belive it's fairly simple but dunno how to start "I'm not a programmer" though here is what I learned:

@slametps kindly help me implementing this feature and I can provide you with different adzan voice's files, if you don't really have time at least tell me how can i get multiple payload in same SocketNotification and I hope I can continue developing it my own...

MehdiMgm commented 5 years ago

Hello. I did a magic mirror with MMM prayer time. how can I change the audio output from HDMI to AUDIO JACK I fix everything with raspi-config but it does not work. thank you

MehdiMgm commented 5 years ago

in node helper.js MMM Prayer time folder i try to change :

/* Magic Mirror

var NodeHelper = require("node_helper"); var async = require('async'); var exec = require('child_process').exec;

module.exports = NodeHelper.create({ // Subclass start method. start: function() { console.log("Starting node_helper.js for MMM-PrayerTime."); },

socketNotificationReceived: function(notification, payload) {
console.log(this.name + " node helper received a socket notification: " + notification + " - Payload: " + payload);
if (notification == "PLAY_ADZAN") {
  var adzanSound = 'adzan.mp3';
  if (payload.occasion) {
    if (payload.occasion=="FAJR") {
      adzanSound = 'adzan-fajr.mp3';
    }
    else if (payload.occasion=="IMSAK") {
      adzanSound = 'imsak.mp3';
    }
  }
  var adzanCmd = '/usr/bin/omxplayer -o hdmi modules/MMM-PrayerTime/res/' + adzanSound + ' &';
  async.parallel([
    async.apply(exec, adzanCmd)
  ],
  function (err, res) {
  });
    }
},

}); /usr/bin/omxplayer -o hdmi modules/MMM-PrayerTime/res/' + adzanSound + ' & to /usr/bin/omxplayer -o both modules/MMM-PrayerTime/res/' + adzanSound + ' &

source : https://www.raspberrypi.org/documentation/usage/audio/README.md

slametps commented 5 years ago

Can you play other audio file and get the output to audio-jack normally using that command?

MehdiMgm commented 5 years ago

Can you play other audio file and get the output to audio-jack normally using that command?

Hello, yes indeed with this configuration I try an audio file with VLC Player and it works very well. I changed the adhan with this one: https://www.youtube.com/watch?v=SfkLi6slcIs