Start a Conversation

Solved!

Go to Solution

1615

May 18th, 2020 14:00

Using Dell Latitude as an alarm clock

Dell Latitude E7250 with Windows 10.  

I want it to play a music file as a wakeup alarm.  

So I made a task to play the music file and scheduled it to run at a certain time.  It does wake the computer out of sleep, but the music file doesn't actually play until I press the power button. 

The display also remains dark until I press the power button.  

How can I get it to start playing the music file automatically, without my intervention?

6 Posts

May 26th, 2020 23:00

I solved it, more or less!  

I found out that Windows Media Player will play music after the laptop has been woken from sleep, but the lid is still closed.  

So I wrote a batch script that plays random music from my music folder, and set it to wake the computer.  

It would still be nice to know why Windows Media Player can do this, but my calendar program can't.  

Here's the batch script that works:

------------------------------------------------------------------

@echo off
setlocal
setlocal EnableDelayedExpansion
rem store the matching file names in list
cd C:/my/music/directory
dir /b *.wav /s > songlist
rem count the match files
type songlist | find "" /v /c > tmp & set /p _count= rem get a random number between 0 and count-1
set /a _random=%random%*(%_count%)/32768
rem we can't skip 0 lines
if %_random% equ 0 (
for /f "tokens=*" %%i in ('type songlist') do (
set _randomfile=%%i
echo !_randomfile!
goto outofloop
)
) else (
for /f "tokens=* skip=%_random%" %%i in ('type songlist') do (
set _randomfile=%%i
echo !_randomfile!
goto outofloop
)
)
:outofloop
start wmplayer /b %_randomfile%
timeout /T 15 /nobreak
taskkill /IM wmplayer.exe /F
echo !_randomfile! >song

----------------------------------------------------------------

6 Posts

May 18th, 2020 23:00

It worked OK this morning!  

I set it to "do nothing" when the lid is closed, but to sleep after 15 minutes of inactivity.  That may have been the change I made that worked.

Then I have a wakeup timer that wakes the computer from sleep just before the alarm is set to go off.

 

6 Posts

May 20th, 2020 00:00

And it didn't work this morning ...

So what was different?

No Events found!

Top