TatriX / pomidor

Pomidor is a simple and cool pomodoro technique timer.
238 stars 17 forks source link

unable to play sounds #41

Closed tiktaaliki closed 4 years ago

tiktaaliki commented 4 years ago

hi, thanks for this great package. I have 1 issue which is that the sounds don't seem to work. I looked through the other issues, and tried this (pomidor--play-sound-file pomidor-sound-overwork) to test the sound, and I get the response "searching for program: no such file or directory, async".

async.el is installed on my emacs -- i'm not super tech savvy so I'm not sure if this is the async that's being referred to. do you have any thoughts on how i can troubleshoot this? thank you!

TatriX commented 4 years ago

Could you please show value of command-line-args variable? C-h v command-line-args RET should do the trick.

tiktaaliki commented 4 years ago

the value of command-line-args is "emacs", thank you!

TatriX commented 4 years ago

Thanks, then can you please try (play-sound-file pomidor-sound-overwork)? It is a native Emacs function which plays sounds.

tiktaaliki commented 4 years ago

hi, for some reason (play-sound-file pomidor-sound-overwork) doesn't work when the files are in the pomidor folder in elpa, but when i move the sound files out into my .emacs.d folder, the (play-sound-file xxx) function works. (same for pomidor-sound-tick, pomidor sound tack, etc.) i changed all the file locations in my config to match their new locations, but the sounds still don't work. It might be tied to something wrong with my alerts? when my break session ends, I get this message: Error running timer ‘pomidor--update’: (file-missing "Searching for program" "No such file or directory" "async")

TatriX commented 4 years ago

Hard to tell. Can you please (toggle-debug-on-error) and then reproduce an error. You should get a *backtrace* buffer with a stacktrace, which hopefully will help us understand problem further.

tiktaaliki commented 4 years ago

hi, here are the contents of the backtrace buffer. thank u!

Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "async")
  #<subr make-process>(:name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav"))
  apply(#<subr make-process> (:name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")))
  make-process--with-editor-process-filter(#<subr make-process> :name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav"))
  apply(make-process--with-editor-process-filter #<subr make-process> (:name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")))
  make-process(:name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav"))
  apply(make-process (:name "my-pomidor-play-sound" :buffer nil :command ("async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")))
  start-process("my-pomidor-play-sound" nil "async" "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")
  (lambda (file) (start-process "my-pomidor-play-sound" nil "async" file))("~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")
  pomidor--play-sound-file("~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")
  pomidor--update()
  apply(pomidor--update nil)
  timer-event-handler([t 24324 49022 689284 1 pomidor--update nil nil 999000])
TatriX commented 4 years ago

Can you share your pomidor's config?

tiktaaliki commented 4 years ago

here it is (the only thing i've changed is the file paths for the sounds)

(use-package pomidor)
(setq pomidor-save-session-file "~/Dropbox/emacs/.emacs.d/pomidor-session.json")
(setq pomidor-sound-break-over "~/Dropbox/emacs/.emacs.d/sms-alert-1-daniel_simon.wav")
(setq pomidor-sound-overwork "~/Dropbox/emacs/.emacs.d/overwork.wav")
(setq pomidor-sound-tick "~/Dropbox/emacs/.emacs.d/tick.wav")
(setq pomidor-sound-tack "~/Dropbox/emacs/.emacs.d/tack.wav")
TatriX commented 4 years ago

I can see a reference to my-pomidor-play-sound in stacktrace you posted but I can't see it in your configuration. Perhaps you have it in custom.el? Can you please show value of pomidor-play-sound-file.

tiktaaliki commented 4 years ago

ah, so when sounds weren't working, I tried the function you listed on the readme:

(setq pomidor-play-sound-file
      (lambda (file)
        (start-process "my-pomidor-play-sound"
                       nil
                       "mplayer"
                       file)))

which is why that showed up in the backtrace. i've since restarted, and the value of pomidor-play-sound-file is currently ‘pomidor-play-sound-file-emacs’

since restarting, the alert sounds seem to be working (though i'm not sure what the change is -- they weren't working when I tried the function above), but the tick tack still isn't playing.

the alerts working are a huge help -- if i could get the tick tack to play that wld be great, but if the problem's not easy to discern at the moment, i can live without it. thank you!

TatriX commented 4 years ago

Ah, I found out what's wrong! Call to tick-tack function was removed here: https://github.com/TatriX/pomidor/commit/1ad9a88e90c36fbf424eabed5a85eda89ac995ff#diff-d8f77d52aac22abafa5bd4d6cfa0a425L349 @wandersoncferreira any particular reason for removing it or it was by accident?

TatriX commented 4 years ago

@tiktaaliki I've added the call back, so it should work with a last commit.

tiktaaliki commented 4 years ago

thank you!

wandersoncferreira commented 4 years ago

I believe it was an accident.