c# windows phone 8 app, change system volume - c#

I use WASAPI (Windows Audio Session API) in my windows phone app to play some single tone.
How i can change system volume of device, so when user click on "play" button, even if volume = 0 (muted) signal will be heard.
i tried to use ISimpleAudioVolume interface(http://msdn.microsoft.com/en-us/library/windows/desktop/dd316531(v=vs.85).aspx) but it change volume level of an audio session but if device in mute signal is not heard.
please help.

Related

Windows sleep even for UWP apps

In my app I have UP and DOWN channels which continuously listen for Audio stream.
I want to know that In windows is there any event which will tell me that machine is now going to sleep state (not sign-out because machine will go to sleep after sign-out based on the user settings) so that i can suspend the channels and once machine wake-up(Not sign-in because machine wake up before the sign-in even) then i can resume it again.
Something similar to Cortana
Thanks in advance.
There's no 'sleep' relevant APIs for you to detect if the windows will go to sleep in UWP.
If you check the Windows 10 universal Windows platform (UWP) app lifecycle, you will find that Suspending and Resuming are the right events to listen to.

Windows Phone 8.1 connecting to Bluetooth Smart Heart Rate Monitor

I'm having issues trying to find my Bluetooth Smart heart rate monitor in a Windows Phone app I'm creating. To start I'm using the sample app from MSDN that demonstrates use of the Bluetooth Generic Attribute Profile (Gatt) Windows Runtime API. This is a new API available for WP 8.1.
The following snippet is where the heart rate monitor discovery takes place:
var devices = await DeviceInformation.FindAllAsync(
GattDeviceService.GetDeviceSelectorFromUuid(GattServiceUuids.HeartRate),
new string[] { "System.Devices.ContainerId" });
After debugging on my phone the devices found is always zero. After some research I believe this is because the DeviceInformation.FindAllAsync method only returns devices that has been already paired on the phone using the system settings. I am unable to pair my heart rate monitor in the Bluetooth system settings as it cannot find it. I've tested it on my PC and it can find the heart rate monitor however it always fails when I try to pair it.
One thing to note is that I am able to use my heart rate monitor with the Adidas miCoach app (which does not require pairing through the system settings). The discovery and connection takes place directly in the app. Does any know how this works?
My hardware:
Wahoo Tickr heart rate monitor
Lumia 925 (OS version: 8.10.12397.895)
Resources:
MSDN Sample - Bluetooth Generic Attribute Profile - Heart Rate Service
Channel9 - Apps for Bluetooth Smart Devices
UPDATE 2014-07-23:
I'm running the Lumia Cyan update and the Tickr heart rate monitor now shows up in the Bluetooth system settings, however I am unable to pair it. I get the error message "couldn't connect". This is the same behaviour as on a PC. Interestingly I can no longer connect the Tickr heart rate monitor to the miCoach app. It seems like they updated the app and the page for configuring a heart rate monitor has changed.
You'll need Windows Phone 8.1 with Nokia Cyan update, otherwise you won't be able to pair your HRM. For testing, you could get an HTC phone, or a 630, that comes with Cyan.
The phone itself supports BLE heart rate monitor obviously, but the API to access the monitor is private. That's why micoach / Sports Tracker can access it, but your app (which uses the official 8.1 API) cannot until Cyan.

Play audio notification in Windows phone 8 when app is in background

I am developing a windows phone 8 which fetches location even app is in background.
I want to give user some audible notification ( Specifically play an audio mp3 file) when app is in background? Is it possible? How can i acheive that?
You can realize this feature with using toast notifications for Windows Phone 8 with Update 3 (OS version number 8.0.10492). In that OS version you can add custom sound to toast notification. Sound files can be in WAV, WMA, or MP3 format, must be less than 10 seconds long, and must be stored in the app’s installation directory or local storage folder.
Using custom sounds in toasts on Windows Phone 8 Update 3

how to set volume of remote machine to the maximum level [duplicate]

Windows 7 has per-application volume controls that let you mute applications individually. How can I mute and unmute an application from a console app?
You'll want to use the IAudioSessionManager2 COM interface. Have a look at Vista Core Audio API Master Volume Control that wraps some of the new Core Audio APIs. The console project therein enumerates active audio sessions and lets you tweak volume and mute status of an active audio session.

Details of Nokia Music audio track, on Windows Phone?

When using Nokia Music, or any other audio streaming app on Windows Phone, is there any way of detecting what track is being played, like you would be able to with a normal audio file being played locally (through the Music+Video Hub), via the MediaPlayer object?
any other audio streaming app on Windows Phone
You definitely can do it with my audio streaming app. While it plays something in background, press a volume up or down button, and you'll see the artist & title of the song being played:

Categories

Resources