crontab 不能定时播放音乐
Tofloor
poster avatar
anye7up
deepin
2017-09-29 06:44
Author
我在shell中可以正常使用mplayer播放音乐。
但用crontab建立的定时任务却总是不能成功,请问下有人知道该如何解决吗?
环境变量的问题的话,是不是加上
  1. #!/bin/bash
  2. . /etc/profile
  3. . ~/.bashrc
Copy the Code
我有加,可是依然没效果 。日志输出结果如下

==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 48000 Hz, 2 ch, s16le, 320.0 kbit/20.83% (ratio: 40000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
shm_open() failed: No such file or directory
AO: [pulse] Init failed: Protocol error
Failed to initialize audio driver 'pulse'
shm_open() failed: No such file or directory
[AO_ALSA] alsa-lib: pulse.c:243pulse_connect) PulseAudio: Unable to connect: Protocol error

[AO_ALSA] Playback open error: Connection refused
Failed to initialize audio driver 'alsa'
[AO SDL] Samplerate: 48000Hz Channels: Stereo Format s16le
[AO SDL] using aalib audio driver.
[AO SDL] Unable to open audio: No available audio device
Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


Exiting... (End of file)


Reply Favorite View the author
All Replies
avatar
qiujieqiong
deepin
2017-09-29 17:44
#1
音乐文件放在哪里
Reply View the author
avatar
anye7up
deepin
2017-09-30 05:07
#2
https://bbs.deepin.org/post/146128
音乐文件放在哪里

~/Music/CloudMusic/
Reply View the author
avatar
DebuggerX
deepin
2017-09-30 05:36
#3
要用绝对路径
Reply View the author