MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. mZuil
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by mZuil

    • RE: Trouble playing audio file

      @bugsounet It actually works!! 😊 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 🤗

      posted in Troubleshooting
      M
      mZuil
    • RE: Trouble playing audio file

      I am writing this code in the node_helper file

      posted in Troubleshooting
      M
      mZuil
    • 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?

      posted in Troubleshooting
      M
      mZuil
    • 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? 😢

      posted in Troubleshooting
      M
      mZuil
    • 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!

      posted in Troubleshooting
      M
      mZuil
    • 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 command

      Some 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! 😃

      posted in Troubleshooting
      M
      mZuil
    • 1 / 1