Closed theramez closed 4 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
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
Can you play other audio file and get the output to audio-jack normally using that command?
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
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:
add a new
voice
option in default configs and set it tofalse
just like
method
user should set it to 1 for mekka and 2 for abdulbasit.....etcin
MMM-PrayerTime.js
it should communicate normally with node helper bythis.sendSocketNotification("PLAY_ADZAN", {payload});
now the payload should contain bothoccasion
andthis.config.voice
in
node_helper.js
when recieving both datathis way we'll assign each voice by a file as example for mekka "which is voice 1" file is adzan1.mp3 and for abdulbasit "which is 2" file is adzan2.mp3 and so on
@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...