Roger Price wrote: 
> On Fri, 24 Jan 2025, Dan Ritter wrote:
> 
> > > On Fri, 24 Jan 2025, Roger Price wrote:
> > >  rprice@maria ~ /usr/local/bin/bark.sh 5
> > >  bark.sh starts ... XDG_RUNTIME_DIR=/run/user/2108
> > >  bark.sh calls Biff ... XDG_RUNTIME_DIR=/run/user/2108
> > >  Playing Sparc Audio '/mnt/home/rprice/bark/h5.au' : Mu-Law, Rate 8000 
> > > Hz, Mono
> > > 
> > > I hear the bark.
> 
> > What is it using to play the .au file? OSS, ALSA, or something
> > else?
> 
>  rprice@maria ~ aplay -v ~/bark/h5.au
>  ALSA <-> PulseAudio PCM I/O Plugin
> 
> > I would guess that VLC is triggering the start of PulseAudio,
> > and after that PA has disabled OSS.
> > 
> > After VLC runs, does aplay work to play sounds?
> 
> Yes and no.  Yes - I can manually run aplay and hear the sound.  No - a cron 
> job
> cannot use aplay and gets the error message:

Got it.

OK, PulseAudio takes over ALSA, and from then on, only sessions
with PA active can play sounds. That means that your shell can
do it, but your cron can't.

Add this to your cron invocation or bark.sh.

export PULSE_RUNTIME_PATH="/run/user/$(id -u)/pulse/"

-dsr-

Reply via email to