|
@@ -27,6 +27,7 @@ func ExecShell(cmd string) error {
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 播放给定的音频文件 (异步)
|
|
|
func PlayAudioAsync(filePath string) {
|
|
func PlayAudioAsync(filePath string) {
|
|
|
go func() {
|
|
go func() {
|
|
|
if err := exec.Command("aplay", filePath).Run(); err != nil {
|
|
if err := exec.Command("aplay", filePath).Run(); err != nil {
|
|
@@ -49,6 +50,7 @@ func GetCPUTemperature() (float64, error) {
|
|
|
return float64(temp) / 1000.0, nil
|
|
return float64(temp) / 1000.0, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 播放开机欢迎提示音 (异步)
|
|
|
func PlayWelcomeAudio() {
|
|
func PlayWelcomeAudio() {
|
|
|
filePath := filepath.Join(baseapp.EXEC_DIR, "voices/welcome.wav")
|
|
filePath := filepath.Join(baseapp.EXEC_DIR, "voices/welcome.wav")
|
|
|
PlayAudioAsync(filePath)
|
|
PlayAudioAsync(filePath)
|