@bugsounet It actually works!! :smiling_face_with_smiling_eyes: It happened because I was using the “use strict” directive, but without it, everything works as it should.
Wow, guys, you helped me a lot!! I will add you in the acknowledgement section of my final degree project hahaha :hugging_face:
Read the statement by Michael Teeuw here.
Posts made by mZuil
-
RE: Trouble playing audio file
-
RE: Trouble playing audio file
I am writing this code in the node_helper file
-
RE: Trouble playing audio file
Thanks to both of you!
I have just tried the code and it works in a js file, but when I try to replicate this code in the MMirror I get the error that opts is not defined. Where do I have to declare opts? -
RE: Trouble playing audio file
@sdetweil Sorry, I couldn’t try it before.
It doesn’t work :( I am a beginner and I don’t understand well what is happening, could you help me, please? :crying_face: -
RE: Trouble playing audio file
@sdetweil Yeah, the monitor I use has speakers and I have tried to reproduce YouTube and even this mp3 o wav file without the Magic Mirror started and it works, but when I call some functions to execute the audio with the Magic Mirror it doesn’t work. I am generating this audio with gtts and I don’t know if the problem is because those two actions are executed at the same time:
const gTTS = require('gtts'); var play = require('play').Play(); var gtts = new gTTS('text to speak', 'es-es'); gtts.save('/tmp/hello.wav', function (err, result) { if(err) { throw new Error(err) } console.log('Success! Open file /tmp/hello.mp3 to hear result.'); }); play.sound('/tmp/hello.wav');
The code below is one of the many attempts I have tried :(
Thanks for the response! -
Trouble playing audio file
Hello everybody, I am currently having some issues playing an mp3 or wav file.
So far I have tried the following packages in the node_helper but none seem to work:
play
a-play
play-sound
sound-play
play-audio
node-aplay
child-proccess executing cvlc commandSome of them give errors and the others do not produce any sound.
I am asking for help over here since I have been working the last couple of days and I could really use some help.
Thank you in advance! :D