I was getting utterly annoyed by the fact that the TF3D music player had no sleep funtion (turn of the music after a set amount of time). After doing some searches I was unable to find anything that suits my needs (anything at all in fact).
Now I have been using an application that pauses my music when I press the headset button for 1 second. What that app in fact does is: run an executable that somehow pauses the TF3D music player.
So in combination with 3 lines of mortscript I had my sleep application. Just run it (you will need to have mortscript installed, http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view) and enter the amount if time (in minutes) after which you wan't the music player to stop playing. I usually set this to 1 hour, put on my headphones and fall somewhere within that hour to sleep. The players turns off and I won't wake up at 3 'o clock in the morning when I would rather be sleeping because of some loud track that starts playing.
The sddialer.exe file (which pauses the player) was developed by DYNAMIC+ (http://forum.xda-developers.com/showthread.php?t=502881). If the original developer has any problems with me redistributing a piece of his work, contact me.
The mortscript file (for the interested ones)
Code:
t = Input("Minutes until sleep","TF3D Music Sleep",1);
Sleep(60000*t);
Run("SDDialer.exe");
That's all there is to it, the pausing is handled by the SDDialer.exe file. which I did NOT write myself. So in case you find any error related to SDDialer.exe, you should contact DYNAMIC+ (the original dev). Because the SDDialer.exe file was originally written to be used in conjuction with a headset, it only works when a headset is plugged in! (don't know how bluetooth headsets are handled though)
Cabbed using the wonderfully simple QuickCab!
After installation you will have a new shortcut in your startmenu, just tap it, enter the amount of minutes and lay back. This works when your device is in sleep-mode, as well as in normal active mode. One remark: the SDDialer.exe file in fact toggles the music playback, so when you don't play music, and you set the timer to for example 10 minutes, the music will start playing after 10 minutes. Could be useful for a countdowncounter with music or something
Test results are ALWAYS appreciated
ill post you the requested source....
Code:
#define AUDIO_MANAGER_COMMAND_PAUSE 0x3
HWND GetAudioManagerWindow( )
{
return FindWindow( TEXT("AUDIO_MANAGER_ENG"), NULL );
}
BOOL IsAudioManagerPlaying( )
{
BOOL bIsAudioManagerPlaying = FALSE;
HKEY hkAudioManagerInformation;
if ( ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\HTC\\AudioManager_Eng\\information"), 0, 0, &hkAudioManagerInformation) )
{
DWORD dwType, dwStatus, dwCbStatus = sizeof(dwStatus);
if ( ERROR_SUCCESS == RegQueryValueEx(hkAudioManagerInformation, TEXT("status"), 0, &dwType, (LPBYTE)&dwStatus, &dwCbStatus) && dwType == REG_DWORD )
{
if ( dwStatus == 4 )
bIsAudioManagerPlaying = TRUE;
}
RegCloseKey( hkAudioManagerInformation );
}
return bIsAudioManagerPlaying;
}
LRESULT SendAudioManagerMessage( HWND hAudioManagerWnd, DWORD dwCommand )
{
return SendMessage( hAudioManagerWnd, WM_USER + 1, dwCommand, 0 );
}
Code:
if ( IsAudioManagerPlaying() )
{
HWND hAudioManagerWnd = GetAudioManagerWindow( );
if ( hAudioManagerWnd )
SendAudioManagerMessage( hAudioManagerWnd, AUDIO_MANAGER_COMMAND_PAUSE );
}
Is it possible to make this work with the speaker function? I quite like the speaker quality on my TP2.
Another feature I would love to see is the gradual decrease in volume. I have a sleep machine that slowly lowers the volume, so when the sound stops it isnt abrupt and possibly causing the person to wake.
Id be a willing beta tester...
sleep machine functionality for TF3D
Nice one, thank you!
I'd second the above suggestion for a gradual lowering of volume, it would be great to have some sort of sleep machine functionality.
Please not that I won't be adding any features/fix bugs on this 'application'. In fact: I don't even use TF3D anymore (Titanium + Nitrogen music player). But if it works for you, I always like to hear that.
Related
Is there a way to turn off, not the backlight, not the pda, but just the screen?
All I know is, I have Linux on my ipaqs, and you can turn off just the screen (the backlight will be off too of course), to save battery power. I usually do this when I'm listening to mp3 with it.
I imagine the hardware itself is capable to do this, but pocketpc by default does not have such an option. Now I'm wondering if pocketpc has exposed any APIs to do this.
Thanks.
I just know PocketDiVX in the new ROM can map a button to do this. No idea how to do it from code though...
this works on my xda with media player
http://homepage.ntlworld.com/gazzaman2k//a/Software/Display off.zip
Apart from setting the power pref's in system/settings, no such luck ... I've searched the XDA for a program that does this with no luck.
Has anyone found a ROM link ?
I like and use Pocket Toolman
http://members.shaw.ca/pockettoolman/
HTH
here's one that's hopefully the answer to your request. the file is called sleepscreen and it does exactly what you mentioned; turns off the screen while applications are running. i've installed it in my "start" menu so that anytime i want to switch off the screen i can do so.
when you click on the icon on your start menu; the screen goes blank and if you'll notice the LED of the xda is blinking...meaning apps are running while the screen is off. all you have to do to activate the screen is press any button (e.g. the contacts or calendar button)...but DON'T hit the power button because that switches off all the apps running.
how do i attach the file in this forum? it's only 24kb zipped. or give me your email address and i'll mail it to you.
hope that helps mate!
Code:
// offDisplay.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include <stdlib.h>
#include <nled.h>
// LED support
extern "C" BOOL NLedGetDeviceInfo(INT nID, PVOID pOutput);
extern "C" BOOL NLedSetDevice(INT nID, PVOID pOutput);
// GDI Escapes for ExtEscape()
#define QUERYESCSUPPORT 8
// The following are unique to CE
#define GETVFRAMEPHYSICAL 6144
#define GETVFRAMELEN 6145
#define DBGDRIVERSTAT 6146
#define SETPOWERMANAGEMENT 6147
#define GETPOWERMANAGEMENT 6148
typedef enum _VIDEO_POWER_STATE {
VideoPowerOn = 1,
VideoPowerStandBy,
VideoPowerSuspend,
VideoPowerOff
} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
typedef struct _VIDEO_POWER_MANAGEMENT {
ULONG Length;
ULONG DPMSVersion;
ULONG PowerState;
} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
// LED handling functions
int GetLedCount()
{
NLED_COUNT_INFO nci;
int wCount = 0;
if(NLedGetDeviceInfo(NLED_COUNT_INFO_ID, (PVOID) &nci))
wCount = (int) nci.cLeds;
return wCount;
}
void SetLedStatus(int wLed, int wStatus)
{
NLED_SETTINGS_INFO nsi;
nsi.LedNum = (INT) wLed;
nsi.OffOnBlink = (INT) wStatus;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
}
int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPWSTR pszCommandLine, int nCommandShow)
{
HDC gdc;
int iESC=SETPOWERMANAGEMENT;
gdc = ::GetDC(NULL);
if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC, 0, NULL)==0)
MessageBox(NULL, L"Sorry, your Pocket PC does not support toggleDisplay",
L"Pocket PC toggleDisplay",
MB_OK);
else
{
VIDEO_POWER_MANAGEMENT vpm;
ExtEscape(gdc, GETPOWERMANAGEMENT, 0, 0, sizeof(vpm), (char *) &vpm);
if (vpm.PowerState == VideoPowerOff) {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOn;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 0);
}
} else {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOff;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 1);
}
}
::ReleaseDC(NULL, gdc);
}
return 0;
}
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
pigeon said:
Is there a way to turn off, not the backlight, not the pda, but just the screen?
I came across some silly software named PocketLight or PocketTorch or so, just can't find it right now. It turns off the screen but the backlight stays on. This way you can use your PDA as a light source in case you lost something in the dark ....
Is that what you're looking for?
Martin
Click to expand...
Click to collapse
Click to expand...
Click to collapse
i have a free program for this but i dont know how to upload it
http://www.mywirelessoffice.com/xda/screenoff.zip
Thanks emilk
Adrian
emilk said:
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
Click to expand...
Click to collapse
Cant link to that exe file, I get a "not authorised", error message.
I know, my webhosting is not perfect
SOLUTION: when I use rightclick and choose 'save target as..'
it goes through
if you are unsuccesful with linking, that was probably intention
of my provider
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
MIke Gascoigne said:
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
Click to expand...
Click to collapse
If I press and hold the power button, it turns off only the backlight, not the screen.
Sorry, just press the power button, this turns the screen off, DONT HOLD IT as I told you to do before.
Just press it!
Mike
That suspends the device. It doesn't just turn off the screen.
If I have Media Player turned on and I just tap the power it turns off the whole device (MP3 player too)
I know this thread is repeated everywhere, but I thought I'd start it up for our GNote forums
What are your Tasker profiles? I just found out how to use Tasker yesterday and I find myself loving it.
Mine are as follows:
1) Incoming Calls - Decrease volume to second lowest setting (I have loud friends)
2) Turn wifi on at home automatically
3) Open PowerAmp when headphones are plugged in
4) Send a "Happy Birthday!" text to various people on their birthdays.
5) Alert me when battery is full to 100%. Really useful if you don't want to overcharge your battery.
What about you guys?
Mute at work locations
Pandora + Bluetooth in car
Wifi at home
100% Battery alert
Auto-off unpaired Bluetooth
Regulated auto-sync based on battery
Long-press search changed to notification drawer open
Screen timeout change for various apps
Data off and screen timeout change for ad-supported games
I posted a couple just recently in this thread...
http://forum.xda-developers.com/showpost.php?p=23151996&postcount=25
Here's a C&P for the lazy....
______________________________________________
Car Profile
Enter Task
1) Disable PIN Security so I don't need to unlock my phone while in the car (one less distraction)
2) Set Media Volume to 15
3) Turn Wifi off
4) Change Display timeout to 30 minutes (nice for google maps and viewing the album art of the streaming music)
5) Turn on GPS IF power is connected to phone
6) Start recording video with DailyRoads Voyager ( A car DVR program in case of an accident so you then have Objective evidence)
7) Play the THX sound after a couple seconds to make sure the Bluetooth audio streaming is working right
Car EXIT task
1) Stop Recording Video for DailyRoads Voyager (DRV)
2) Wait 5 seconds
3) Kill App - DRV
4) Perform Task - PIN ON
5) Secure Settings - Disable GPS
6) Display Timeout - 2 min
7) WiFi - Turn ON
8) Bluetooth - Off
9) Display Brightness - Set to 150 out of 255
Other fun stuff
Home VAR %STATUS_HOME
Set VAR for when I am near my home micro-cell as the signal radius is small and specific to my house. I use this since the phone part is always on and I don't need to use GPS to determine location which uses more juice. That VAR is then used to turn on wifi when I arrive at home, disable PIN again, Flash "Welcome home", set WiFi sleep to Never. The Exit task for when I leave home turns PIN ON and sets the WiFi sleep policy to Never While Plugged"
Power VAR %STATUS_POWER
I have 2 seperate profiles for when I am connected to AC or USB power. The AC one sets the power VAR to 2 while the USB one sets it to 1. Both are used for other tasks and profiles, like the car one above requires AC connection so my GPS doesn't drain my battery even while connected. I have it flash "AC connected" or "USB connected" to let me know if the phone is receiving the correct amount of juice. When both of them exit they set the Power VAR to 0 and flash "Power Disconnected"
Sleepy Time
Profile conditions
1) Time - From 00:01 to 06:30
2) State - Home VAR = 1 (so this doesn't happen when I am out and about somewhere at night)
Enter Task - In case I'm tinkering with the phone in bed and don't want to keep the wifey up with a blazing screen and vibrations when clicking buttons. Also prevents annoying sounds at night by disabling data sync and muting all but the Alarm audio.
1) AutoSync -OFF
2) Flash "Good night"
3) Display brightness at 0
4) Screen Filter set to 25%
5) Perform Task - Alarm Audio only
Alarm Audio only task above
1) Alarm Volume - 4
2) Flash "Alarm Audio Only"
3) Haptic Feedback - Off
4) Notification Volume - 0
5) Ringer volume - 0
6) System volume - 0
7) Media volume - 0
Exit Task
1) AutoSync - On
2) Display Brightness - 255
3) Screen Filter - 100%
Quick Stats - This has two parts. One is the Notification that tells me a bunch of info I like to know like Battery level, Screen timeout, screen brightness and CPU govenor. The second part is launching a menu whe nI click on the the notification that has the commonly used Screen brightness & timeouts I use. I need to add some audio options in there too. I re-discovered that menu was there the entire time and didn't see the + button add more items to the menu. Iwas over complicating it by trying to use Scenes as a pop-up menu. Still need to learn more about Scenes.
Part 1 - Quick Stats Notification
State - Orientation Face Up (I use this state so if I want to refresh the stats all I do put the phone face up. There is automatically a time stamp so I can know when the stats were last updated)
Task - Notify Quick Stats
1) Notify - with Battery level, Screen timeout, screen brightness and CPU govenor variables as the text.
Part 2 - Notification Bar Tool
Event - Notification Click
Task - Quick Stats Menu
1) Menu with options for display brightness at 0, 100 or 255. Display timeout options for 30 secs, 2 min, 10 min and 30 min
Remote PIN Disable - This is for in case I forget my pin this will disable the PIN likew used in the Car and Home profiles. It is triggered by receiving a text from certain people with a specific phrase.
Event - Text with specific phrase under Content
Task - PIN OFF
Where Are You - Here's a 3 part setup. If I can't find my phone I again send a text with a specific phrase that then cranks up all volume settings to MAX and repeat "The Most Annoying Sound in the world" by Jim Carrey from Dumb & Dumber. The text sets a VAR called %SHUTUP to 1. When %SHUTUP = 1 it triggers Part 2. Once I find the phone to set the VAR back to 0 I shake the phone.
Part 1 - Where Are You Status
Event - Received Text with specific phrase
Task - Variable Set - %SHUTUP = 1
Part 2 - Where Are You Status
State - Variable Value = 1
Task - Where Are You Audio
1) Perform Task - Crank It Up (sets all volumes to MAX)
2) Flash - "I'm over here!"
3) Music Play - Annoy.wav
4) Wait - 15 sec
5) Goto - Top of Loop IF %SHUTUP = 1
Part 3 -Shutup Shake
Event - Shake
Task
1) Variable Set - %SHUTUP = 0
2) Flash "SHUT UP!!!"
A couple more but they are straight from the Tasker Wiki
I'm definitely going to have to do those. Right now, all I understand is the basics of Tasker (no where near Variables) but I'll follow your instructions.
Thanks especially for "Where are you"
A few I use....
1). Pocket Lock - Detects when phone is upside down in my pocket and activates WidgetLocker.
2). Read Caller Aloud - Incoming caller name said aloud so I can decide whether I want to answer without looking at my phone.
3). Night Mode - From 00:00 to 06:00 Puts phone into silent mode, plus checks whether Wifi, Data, GPS, or Blutooth are on, and turns them off if they are.
4). Battery Low - When battery gets to 15%, and it's not connected to a charger, Says "Battery low, connect charger" and turns off Wifi, BT, Data, GPS.
5). Music Player - When headset is plugged in, loads music app.
6). Home - Gets general location from cell tower, activates Wifi, disables Data & GPS. Exit Task disables Wifi, and enables Data.
7). Work - Gets general location from cell tower, disables Wifi, Data, GPS, BT, and Auto Replies to sms that im working and will reply when i can.
I'm pretty new to tasker, but have been pretty bored lately and have been working on an addition to my Work profile.
This profile will, use variables to save up to 5 peoples numbers and how many times each has txted me, and txt each of them back, using their names from my contact list in the body of each txt.
So lets say BOB txts me once, his number will be added as a variable, and it will begin counting the txts from him. On the first txt he is send a txt saying, something like. "Sorry BOB, im at work, will reply when i can".
Then DAVE txts, he will be assigned to Sender2, and have a txt sent to him like above, with the second Counter and Number (%CNTR2 and %SNDR2).
BOB, realizing it's an auto-reply, decides to be funny and spam txt me, thinking he will get a reply every time. However, tasker counts his incoming txts, (%CNTR1) and when it reaches a value of 10, send just one more txt saying something like (Thats 10 txts you've sent, seems Im still unavailable).
Profile: Auto Reply
Variables:
%SNDR1 <---- BOBs cell number
%SNDR2 <---- DAVEs cell number
%SNDR3
%SNDR4
%SNDR5
%CNTR1 <---- BOBs txt counter
%CNTR2
%CNTR3
%CNTR4
%CNTR5
%TXTVAR <---- Counter determining whether a txt received is from someone new or a number already saved.
Enter Task:
Code:
1). GoTo label Sender1 if %SMSRF ~ %SNDR1
2). GoTo label Sender2 if %SMSRF ~ %SNDR2
3). " " etc.
4).......
5).....
6). If (%SNDR1 ~ 0) then SetVariable %SNDR1 to %SMSRF
7). If (%SNDR2 ~ 0) and (%TXTVAR = 1) then SetVariable %SNDR2 to %SMSRF
8). If (%SNDR3 ~ 0) and (%TXTVAR = 2) then SetVariable %SNDR3 to %SMSRF
9)........etc.
10).
11). If (%SMSRF ~ %SNDR1) <-------- Label Sender1
Variable Add (%CNTR1 + 1)
If (%CNTR1 = 1)
Send SMS (Tells this person eg. BOB I'm at work)
Variable Add (%TXTVAR + 1)
Else If (%CNTR1 = 10)
Send SMS to %SNDR1 (Thats 10 txts you've sent me)
Endif x2
12). If (%SMSRF ~ %SNDR2) <-------- Label Sender2
Variable Add (%CNTR2 + 1)
If (%CNTR2 = 1)
Send SMS (Tells this person eg. DAVE I'm at work)
Variable Add (%TXTVAR + 1)
Else If (%CNTR2 = 10)
Send SMS to %SNDR2 (Thats 10 txts you've sent me)
Endif x2
13). If (%SMSRF ~ %SNDR3) <-------- Label Sender3
Variable Add (%CNTR3 + 1)
If (%CNTR3 = 1)
Send SMS (Tells this person eg. EMILY I'm at work)
Variable Add (%TXTVAR + 1)
Else If (%CNTR3 = 10)
Send SMS to %SNDR3 (Thats 10 txts you've sent me)
Endif x2
14). ......Etc.
15). ......
I'm still working on it, deciding whether to have the variables reset as they are all filled, 1 at a time, or to make them reset every hour or so. Also whether to make another profile purely for resetting those variables, or add them to this task. Bearing in mind that on my phone it gets rather annoying to manage/edit the task since its currently at 78 lines long.
As I said I was bored.
If anyone is interested in this I can post a backup xml of this somewhere.
TriggerSpasm said:
BOB, realizing it's an auto-reply, decides to be funny and spam txt me, thinking he will get a reply every time. However, tasker counts his incoming txts, (%CNTR1) and when it reaches a value of 10, send just one more txt saying something like (Thats 10 txts you've sent, seems Im still unavailable).
[...]
As I said I was bored.
Click to expand...
Click to collapse
Bored indeed. Anywho, look into arrays in Tasker, that'll make this tracking stuff much easier. Track all of that stuff in one array vs a bunch of different ones. Might clean up the code a little, make it easier to erm.. relieve more boredom?
khaytsus said:
Bored indeed. Anywho, look into arrays in Tasker, that'll make this tracking stuff much easier. Track all of that stuff in one array vs a bunch of different ones. Might clean up the code a little, make it easier to erm.. relieve more boredom?
Click to expand...
Click to collapse
Thanks, I certainly will.
Using Tasker http://www.pocketables.com/forum//showthread.php?t=9680
Scripted Backups using Tasker and TWRP http://www.pocketables.com/forum//showthread.php?t=11435
Beginner’s guide to Tasker http://www.pocketables.com/tag/beginners-guide-to-tasker
Tasks to:
(1) Take photos and email them when a specific text message is received
(2) Lock and password protect the phone when a specific text message is received
(2) Use different keyboards depending on the open app or screen orientation
Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
kukusiek97 said:
Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
Click to expand...
Click to collapse
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
kuzcoed said:
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
Click to expand...
Click to collapse
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
kukusiek97 said:
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
Click to expand...
Click to collapse
Hi,
To play the sound you'll need some code that allows play music, in App.xaml.cs you can use multiple options, but, for what you're looking for I think this would work fine:
Code:
Stream musStr = TitleContainer.OpenStream("alarm.wav");
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
Put that code inside the "m_Timer_Tick" event or put another
Code:
private / public static void
in your code, then call it.
For example:
Code:
private static void playSound(string Sound)
{
Stream musStr = TitleContainer.OpenStream(Sound);
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
}
Call that with the m_Timer_Tick event using:
Code:
playSound(mysound.wav);
Requirements of doing this way is that:
1) Sample Rate must be between 8k Hz and 48k Hz
2) The audio file must be a PCM wave file
3) Can only be mono or stereo
4) Must be 8 or 16 bit
Hello,
I have a motorola Moto Z2 Force. Like many other motorola, it has a problem: the minimum Media volume (one step above mute) is WAY to lout. (step one is about 36% of the max scale).
In Engineer mode you can set values for each step. But on my Moto there is no Engineer mode since as far as I understood it is only available for Mediatek devices.
I am wondering, in wich file are the volume steps defined? I would like to edit them manually. (>Yes my device is rooted..)
I do not want to use programs like precise volume or things like that.. I would just like to edit the setting and have it done.. I already increased the steps of the slider.. but that does nothing more than adding more steps between 36% volume and 100% volume.
I would like to transform that 36% to about 5%...
I am on Android 8.0.0 latest security update.
Thank you!
Best regards
Sharky
ok guys,
i found out that i have to edit this:
/** Minimum volume index values for audio streams */
protected static int[] MIN_STREAM_VOLUME = new int[] {
1, // STREAM_VOICE_CALL
0, // STREAM_SYSTEM
0, // STREAM_RING
0, // STREAM_MUSIC
1, // STREAM_ALARM
0, // STREAM_NOTIFICATION
0, // STREAM_BLUETOOTH_SCO
0, // STREAM_SYSTEM_ENFORCED
0, // STREAM_DTMF
0, // STREAM_TTS
1 // STREAM_ACCESSIBILITY
};
Click to expand...
Click to collapse
inside the audioservice.java file.. problem is, i dont seem to be able to find this file.. where is it located??
Nobody has an idea on how to change the min. volume of the media, keeping the max volume the same? I am still stuck and found nothing so far...
Hello,
I would like to detect the ringer mode..so here is the code I am currently using.
Below is the code inside onCreate...
BroadcastReceiver receiver=new BroadcastReceiver(){
@override
public void onReceive(Context context, Intent intent) {
AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
Log.i("MyApp", String.valueOf(am.getRingerMode()));
}
};
IntentFilter filter=new IntentFilter(
AudioManager.RINGER_MODE_CHANGED_ACTION);
registerReceiver(receiver,filter);
1. When the app runs first time, it printed 0. (Even if my phone ringer mode was normal, it always prints 0 first time when my app runs)
2. I tried to change to vibrate mode...normal mode......however, it never printed. I think that onReceive is not getting called even if I changed the ringer mode to vibrate/normal...
Here is another testing...
I created a simple button..and when the button is clicked, I called getSystemService and getRingerMode to print the value...
I noticed it always prints 0, which is RINGER_MODE_SILENT... I changed my phone to vibrate mode..and it still prints 0....I changed my phone to normal mode..but it still prints 0...
BTW, SDK version is 28 (API 28: Android 9.0(Pie))...
Could this be a permission issue? I don't think I would need to add some permission in order to use RINGER_MODE_CHANGED_ACTION...
Any idea?
Any help much appreciated.
Thanks,