在启动屏幕播放音频文件吗?

在启动屏幕播放音频文件吗?

所以我对 Linux 和 Ubuntu 并不陌生,但也不是专业人士。我下载了 Xubuntu 并开始进行一些自定义(主题、背景等)。

我想做的一件事是在第一个启动画面弹出时添加启动声音,在登录画面之前,目前没有声音播放,甚至 Ubuntu 的“system-ready.ogg”也没有,但登录后其余系统声音都可以播放(将声音主题设置为 Ubuntu 并且文件存在)。我很容易就找到了如何在登录时添加自定义声音的方法:https://ubuntuforums.org/showthread.php?t=1869787使用“Sox”(通过使用“play /audio/directory”将程序添加到自动启动中)所以我尝试在local.rc中执行相同操作我首先创建一个播放音频文件/usr/src/bootsound.sh的脚本在脚本文件中我有以下内容...

#!/...
play /home/toshibaxu/Music/boot.ogg

我可以运行该脚本,并且它会在终端中播放音频文件,无论我双击还是使用终端命令,这似乎都很好。因此,我将其添加到 local.rc 中,其中当前包含以下内容...

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

sh '/usr/src/bootsound.sh
exit 0

但是音频文件在启动时无法播放,我尝试搜索了好几遍,但似乎找不到任何关于在启动屏幕上播放音频的信息。我承认我可能完全搞错了,我不知道。有什么想法吗?提前谢谢。

相关内容