Score:0

want to play audio files wav or mp3 with sudo

ad flag

The problem persists only when using sudo. for example if I'm using nvlc <some.mp3> its working fine. If I use sudo nvlc <some.mp3> I can see the gui as processing but can't hear the sound from speaker. I want any package or solution to play an mp3 file with sudo. Is it possible? NOTE:- I must use the command with sudo.

Score:0
in flag
CPH

There's an environment variable that is set for your normal user that isn't set (or isn't set to the right thing).

Is there a specific reason you are wanting to use sudo to play audio if playing it with your user id works fine?

P.S.

For reference, this is the variable (as far as I'm aware): XDG_RUNTIME_DIR

EDIT

For current session only: XDG_RUNTIME_DIR=/run/user/1000

You set this as a global root variable if you'd like to keep it instead of needing to set it each time you open a terminal. Can't remember where you set it though, but if you Google "set global root environment variable" you should be able to find it

CPH avatar
in flag
CPH
I can try! So you need to set the variable. From what I found on Google (and is set on my pi) is /run/user/1000. So using , you first need to set the variable. See edit above for more details.
ad flag
yes there's a specific reason..... can you describe a bit better the steps cause m a noob
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.