Hi Guys!
I just wasted a very frustrating weekend to try to set the volume of a wav file, i play via the PlaySound function. waveOutSetVolume does not seem to have any effect on it.
Anyhow i do not quite get the damned volume control concept on Smartphones, if there is any.
The same code runs fine on a PocketPC device and the wav files i play via PlaySound are played using the system volume, which is quite nice.
Now on my Smartphone device i get the maximum possible volume which guarantees an acoustic shock. Even with the bloody phone in your pocket you can easiely hear the audio playing from a 100meter radius. I don't want to imagine what happens, when you are in a voicecall and hell breaks loose.
So how is this supposed to work?
What i want to do is this:
Get Notification volume of currently active smartphone audio profile
Play wav file from memory with notification volume
I guess i am asking for too much. *sigh*
I do not really want to write tons of code to utilize the bloody waveOut API. I don't need to play 50MB files from the storage card, just a few custom wav notifications, which are part of a C# .resx file.
So if anybody can point me to a resource that explains the volume handling on smartphones that would be very helpfull. I hope M$ has spent some thoughts on this and not just implemented all these profiles and volume settings for their own internal phone application without giving access to these settings to the outside world.
Also any C# PInvoke example of how to use the waveOut API for playing wav files from a byte array / memory would be helpful, if i really have to go with the hard & painfull approach.
Thanks,
Tobias
i used this:
http://pinvoke.net/default.aspx/coredll.waveOutSetVolume
Hi oldsap!
Yes i tried using waveOutSetVolume, but it doesn't seem to have any effect, if the wav file is played via PlaySound.
Guess the waveOutSetVolume only works, if you use waveOutWrite as well, and given my current C# experience level it'll take me probably 3weeks to adapt one of the waveOut API play from file examples to work with my embedded *.wav files in the *.resx ressources.
Any other ideas?
Thanks,
Tobias
I used playsound to play the wav file and it worked fine on my T-Mobile SDA smartphone.
This is a snippet from my application in VB:
...
Dim v As Integer
reg.GetDWORDValue(reg.HKCU, key, vol, v) 'get set volume for my application
Dim ov As Integer
reg.GetDWORDValue(reg.HKCU, "ControlPanel\Volume", "Volume", ov) 'get set volume of device
waveOutSetVolume(IntPtr.Zero, v)
sound.Play()
...
waveOutSetVolume(IntPtr.Zero, ov) 'set the volume back to the device volume settings
Hm, intresting..
So you call waveOutSetVolume without a handle and that works?
No waveOutOpen / waveOutClose anywhere necessary?
Well i'll try that this evening.
I did a waveOutOpen, waveOutSetVolume, waveOutClose, PlaySound and that didn't work.
I haven't tried waveOutOpen, waveOutSetVolume, PlaySound, waveOutClose yet.
Cheers,
Tobias
yes sir. that's all i did and it worked fine.
Related
Under my earlier ROMs worked everything well, but now when I try to set my own melody for alarms (those under Time controll panel) it does not work properly and the terrible T-Mobile's beeping is ringing instead. Can anybody help me?
Convert your files that you want as alarm tones, crop them so they aren't too big, and paste them in your windows directory
...missunderstanding: I have my melodies in Windows folder, they are visible and selectable under the controll panel, they are really selected as active (Nancy Sinatra Bang Bang at 7:20 a.m. and another melody for the launch time every working day), but ringing is another melody.
if the files are too big they won't work either, i've yet to figure out the specifics, but as long as it is small enough, and a wav, it should work. i'd try converting with different sample settings and what not, different bit rates and all that.
But the same sound files (exactly the same) worked for me under 2.24 Orange :shock:
kmozis said:
But the same sound files (exactly the same) worked for me under 2.24 Orange :shock:
Click to expand...
Click to collapse
Did you happen to install PocketMusic (or any other music/audio program for that matter)?
PocketMusic likes to take over the associations for certain files (say mp3s, etc.), which in turn doesn't allow the WM op. system from using them as ringtones, alarms, etc.
If that's the case, remove the file association from these programs to allow you to reassign the desired tones for your alarm.
No, this is not the case. I have installed Resco Audio Recorder, but this application havn't stolen the associations. And the custom melodies for my contacts work still perfectly, only for alarms and reminders is used T-Mobile's beeping instead of my melodies...
Problem seems to be solved. It was caused by Spb Pocket Plus. When I changed in the registry HKLM\SOFTWARE\Spb Software House\Pocket Plus\1\AlarmsEnabled (DWORD) from 1 to 0, my settings are now taken into the consideration by my Wizard. There is as weel the key (STRING) DefaultPlaySoundOptions and the value of this key was alarm2.wav and some strange figures. I really do not know where these settings borned, but I am happy to disable them...
kmozis said:
Problem seems to be solved. It was caused by Spb Pocket Plus. When I changed in the registry HKLM\SOFTWARE\Spb Software House\Pocket Plus\1\AlarmsEnabled (DWORD) from 1 to 0, my settings are now taken into the consideration by my Wizard. There is as weel the key (STRING) DefaultPlaySoundOptions and the value of this key was alarm2.wav and some strange figures. I really do not know where these settings borned, but I am happy to disable them...
Click to expand...
Click to collapse
Glad you figured it out, because I just about ran out of ideas since it works fine on mine. (Changing the codec for your .wav file to a more PCM friendly version was the next idea)...
Hi Guys, I've used PDAs for years and just moved up from an Orange SPV-C500 to the Qtek 9100 so I'm fairly familiar for the general working environment but new to this device. I'd appreciate some advice or help with the following:
1) Can you set up the 9100 to lock itself with a button combination or do you have to go via the touchscreen every time.
--> Edit: Found Matt Armstrong's DeviceLock app (http://www.mr2-power.com/downloads/DeviceLock.CAB) and mapped it to the voice record button.
2) I have managed to freeze the Qtek a few times while exploring its features and probably by loading too much up at once but the issue here is that occationally when I push the reset switch it powers up again with the backlight off - is this a known issue and is there a quick way of turning it on (button presses?) rather than having to squint at the display while holding it near to a desk lamp!?
3) I've used Resco Audio Recorder on my PDA (iPAQ 4155) with no problems but recording on the Qtek is jumpy and the elapsed time counter takes about 1.5 seconds to clock up every second - anyone else seeing this kind of behaviour? Is the processor just not up to it?
-->> Edit: Dropping down to 8KHz sampling didn't make a lot of difference but switching to Resco's .raf format produces decent recordings with the realtime clock ticking over at the correct rate.
4) Can you replace the standard 'phone' app with a third party one? If so, what's available.
Thanks
Linker3000
3,. depends what format you use in Resco AR. IN general, it won't be able to record correctly into Speex and almost surely into Ogg when not overclocked. Are you using one of these two formats?
Menneisyys said:
3,. depends what format you use in Resco AR. IN general, it won't be able to record correctly into Speex and almost surely into Ogg when not overclocked. Are you using one of these two formats?
Click to expand...
Click to collapse
Nope - using the deault which is 11KHz, 16-bit, 96Kbps MP3. I'll have a play with the settings and see what happens.
Edit: Dropping down to 8KHz sampling didn't make a lot of difference but switching to Resco's .raf format produces decent recordings with the realtime clock ticking over at the correct rate.
linker3000 said:
Nope - using the deault which is 11KHz, 16-bit, 96Kbps MP3. I'll have a play with the settings and see what happens.
Edit: Dropping down to 8KHz sampling didn't make a lot of difference but switching to Resco's .raf format produces decent recordings with the realtime clock ticking over at the correct rate.
Click to expand...
Click to collapse
Well, RAF is far less storage-friendly than, say, MP3. You may want to consider sticking to, say, NoteM if you want both quality and not very space-consuming recordings.
Please also see http://www.pocketpcmag.com/blogs/menneisyys/112005SoundRecorderApps.asp for more info on all these q's.
and about 2:
no, its not normal, maybe u need to replace ur unit...a workaround...press the power button, it should turn on the display automatically when it comes back from standby...
I need SIM unlock program for my Qtec 9100...
I need help!
Do a search for Lokiwiz and/or Awizard
Trashman said:
Do a search for Lokiwiz and/or Awizard
Click to expand...
Click to collapse
aWizard is work, CID is unlock...
SIM doesn't work.
I have done this with program Lokiwiz, everything was right, but my SIM don't work...
HELP
I've been wanting to be able to play MMF ringtones on my phones without conversion.
I have made some progress, but am now stumped. They play, but they also cause the vibrator to run in sync with the music and I can't figure out how to turn it off!
Here's what I've done so far:
1. Downloaded registry from Samsung Blackjack SGH-i607 to identify files needed for MMF playback (BAEFilter.dll, BeatnikPlugin.dll).
2. Ran Dependency Walker to identify other necessary files needed (mobileBAE.dll).
3. Copied BAEFilter.dll, mobileBAE.dll, and BeatnikPlugin.dll to my devices (Tornado and Wizard).
4. Registered BAEFilter.dll and BeatnikPlugin.dll (mobileBAE is not registerable).
5. Now MMF files play, but vibrate!
BeatnikPlugin.dll, I'm not even sure what it's for. Maybe for that cool spectrum analyzer in Samsung's WMP theme? It doesn't need to be registered for MMF playback to work. Only BAEFilter.dll needs to be registered. Viewing MobileBAE.dll in text mode, I did find reference to another file, mobile_300_base.dls. I copied it over too. It didn't make any difference and appears to just contain EQ settings and such.
I have used UltraEdit32 and viewed the file in text mode to see if any registry entries might be able to disable the vibration. I couldn't find any. I copied every single registry entry from the Blackjack referring to BAEFilter.dll and BeatnikPlugin, as well as everything related to their CLSIDs. I also downloaded the contents of the Blackjack's Windows folder and examined the registry entries in the RGU files. I didn't miss a single one, but it still vibrates.
I'm stumped. The MMF ringtones vibrate on both my Wizard (WM6 PocketPC) and Tornado (WM5 Smartphone).
I'm not sure what else I can try...
Just a small question: what did you do to register the dlls?
I downloaded WM5_RegSvrCE.exe and ran in it from Resco Explorer. I think you need to use Resco because it lets you enter arguments.
I plan to see if I can make a CAB installer out of it in case anyone else is interested. If not, it'll at least make it a lot easier for me to install in my own devices.
I know a little more now than I did when I made the post:
BAEFilter.dll needs to be registered for MMF to work at all, and will allow WMP to play them.
BeatnikPlugin.dll needs to be registered for MMF to work as ringtones, notifications, or alarms (can't be used as alarm on PPC for some reason, but Smartphone works fine).
I did find a workaround for the vibrate, it involves changing the registry for:
[HKLM\Drivers\Builtin\NLed]
"Flags"=0
This killed the vibrate on both my Wizard and Tornado. Setting Order=0 to match the Samsung also worked on the Wizard, but not the Tornado (its Order was already 0). Unfortunately, it completely kills vibrate altogether. I seldom need vibrate mode so it's no big deal for me. I'm theorizing the Samsung does something fancy with vibrate mode so that the phone vibrates in sync with the ringtone, but I'm not sure.
I've searched for a registry setting for my HTC Touch to disable the muting effect of an in-process phone call to enable Media Player to play sound.
I found only one instance of a registry setting... it was to change HKCU-Control Panel-SoundCategories-Attenuation
In this key, I have
0...0x0(0)
1...0x1(1)
2...0x2(2)
I've found one post where it says to change 0...0x0(0) to 0...0x0(1)
When I do this, I get
0...0x1(1)
1...0x1(1)
2...0x2(2)
and I am still unable to play a wav file during a phone call.
Can anybody offer any suggestions?
--Yes, I'm trying to get the infamous answering machine to work because my carrier here in China does not have voicemail. This has driven me into the underground obsession of scripting, tweaking, and hacking of my new, wonderful companion...WM6. After 3 months of poking, prodding, reading, buying software (SK Schema, Resco Registry Editor, etc.) I've finally signed up on the board. What a wonderful hobby (now that I've finally backed up a good configuration for myself!!!)
Hi
I've been looking for that tweak for a long time now (see my posts).
The bad news – It looks like nobody knows
The good news – It's possible – works in iSecretary
I think that the difference is the program that plays the wav file. Somehow the one who wrote iSecretary found a way to play wav files without the traditional WM5 ways.
Is there anyone who can help with this? With the powers vested in this forum and the incredible things I've seen here, there must be someone who know hows to pull this off!!!
Application is designed to control BAG (Bluetooth Audio Control) service state on Windows Mobile systems. It can enable/disable audio/microphone routing to Bluetooth headset, set volume and microphone gain, enable/disable voice command launch application.
Writing this little piece of code was inspired by inability of AGEphone Mobile (ver 2.71) to collaborate with Bluetooth headset.
Really it can be used for other purposes as well. You can make some useful shortcuts or use it in some scripting language.
It is “command line” application (no GUI). Command line switches controls application behavior.
There are two working modes: “keep resident” (default: able to save and restore all settings) and “on fly” - for quick change.
Application itself and documentation with samples in attached file.
Thanks alot i'm downloading now!
gui in next ver?
Thank you very much for writing this! Your utility goes alone perfectly with AGEphone Mobile and is perfect for anyone who wants to use a BT headset AND voice command - highly recommended vs. the standard "BTAudioToggle" !
I'm trying to get this to launch via startup to see if it will work with my bt headset and voice command.
I'm just using "\Windows\bagctrl.exe /O"
as my shortcut link but it gives me an error the app isnt signed..I assume I'm probably just an idiot and not making my shortcut right..Can anyone help me please?
vidmabal said:
Application is designed to control BAG (Bluetooth Audio Control) service state on Windows Mobile systems. It can enable/disable audio/microphone routing to Bluetooth headset, set volume and microphone gain, enable/disable voice command launch application.
Writing this little piece of code was inspired by inability of AGEphone Mobile (ver 2.71) to collaborate with Bluetooth headset.
Really it can be used for other purposes as well. You can make some useful shortcuts or use it in some scripting language.
It is “command line” application (no GUI). Command line switches controls application behavior.
There are two working modes: “keep resident” (default: able to save and restore all settings) and “on fly” - for quick change.
Application itself and documentation with samples in attached file.
Click to expand...
Click to collapse
Many thanks, vidmabal - it works like a dream and does exactly what I was looking for!
MrDSL said:
I'm trying to get this to launch via startup to see if it will work with my bt headset and voice command.
I'm just using "\Windows\bagctrl.exe /O"
as my shortcut link but it gives me an error the app isnt signed..I assume I'm probably just an idiot and not making my shortcut right..Can anyone help me please?
Click to expand...
Click to collapse
Yes, application is not digitally signed.
If you want to use it you first must enable not signed applications (but there are plenty of them around).
To do this you can use "Advanced Config" or alternatively set registry value with some registry editor. "Total Commander" or "Resco explorer" can help you performing this task.
Registry key is "HKLM\Security\Policies\Policies" value name is "0000101a" (if not exists create new DWORD value) and must be set to 1.
P.s. I really don't know why you want to run it on startup and expecially with /O key
eazy2001x said:
gui in next ver?
Click to expand...
Click to collapse
Really not.
Application is designed to run without user intervention.
That’s why even all errors are silently ignored: no MessageBox for invalid keys or some other errors.
Even I don't see what GUI can be helpful. Except maybe for microphone gain changing. Volume normally has control keys on Bluetooth device itself.
Of course you can use it with Mortscript or some other scripting language and make some interface in here. Error codes returned (not present in attached document)
0 - No error (all OK)
128 (0x80) - Error redirecting audio (normally occurs if Bluetooth device is not connected)
129 (0x81) - BAG0: device not found
130 (0x82) - Invalid command line parameters
since u coded this, ive got a small question. do u think there is any chance to disable a remote microphone and use the internal one instead?
im asking this because the mic from my car radio totaly fails its job (JVC KD-BT11) and the internal from my phone (x1) is far supirior to it.
Nice work man, just find my bt headset behind the microwave oven (my girlfriend didn't know anything)
I'm going to write a small mortscript to controll the commnd line.
vidmabal said:
Yes, application is not digitally signed.
If you want to use it you first must enable not signed applications (but there are plenty of them around).
To do this you can use "Advanced Config" or alternatively set registry value with some registry editor. "Total Commander" or "Resco explorer" can help you performing this task.
Registry key is "HKLM\Security\Policies\Policies" value name is "0000101a" (if not exists create new DWORD value) and must be set to 1.
P.s. I really don't know why you want to run it on startup and expecially with /O key
Click to expand...
Click to collapse
I'll have to look into it more but I already have advanc config to run unsigned apps..
achmed20 said:
since u coded this, ive got a small question. do u think there is any chance to disable a remote microphone and use the internal one instead?
im asking this because the mic from my car radio totaly fails its job (JVC KD-BT11) and the internal from my phone (x1) is far supirior to it.
Click to expand...
Click to collapse
The application has nothing common with Bluetooth transport. Really it only send control codes to BAG service (Bluetooth Audio Gateway). This one is coded by Microsoft. I think other BT stack providers (for compatibility reasons) also supports such service.
According to documentation there is no such control code to enable only audio and leave microphone untouched. (Maybe there is, but undocumented, as M$ like to do).
Also it depends on BT profiles your device support. Maybe it has some "stereo headset" without mic?
Here i made a mortscript gui for this tool:
just extract to \Program Files\BTAGC
all files are included
Now make a shortcut of config.mscr in your start menu
vidmabal said:
The application has nothing common with Bluetooth transport. Really it only send control codes to BAG service (Bluetooth Audio Gateway). This one is coded by Microsoft. I think other BT stack providers (for compatibility reasons) also supports such service.
According to documentation there is no such control code to enable only audio and leave microphone untouched. (Maybe there is, but undocumented, as M$ like to do).
Also it depends on BT profiles your device support. Maybe it has some "stereo headset" without mic?
Click to expand...
Click to collapse
The radio itself offers "Bluetooth Headset" and "freespeech".
i tried to disable the freespeech (bluetooth settings in winmo) but somehow my phone still uses the radio as microphone.
guess i have to get my soldering iron and make some hardware mods to my radio. looks like disabling a bluetooth mic isnt going to work.
PS: but thx
old post i know, but do you know if there is a way to display the error msgs on screen somehow ? I think im getting errors.
Pytte said:
old post i know, but do you know if there is a way to display the error msgs on screen somehow ? I think im getting errors.
Click to expand...
Click to collapse
Really there is no much error processing here. But you can try to start app from say Mortscript and examine return code. See message #8 for return codes.
Thanks for your effort put into this.
Could you please confirm if/how is it possible to do just one thing:
1. Cyberon Voice Speed Dialer installed on phone.
2. BT button does not invoke it (audio route opened, and dialer screen opened, but no Speed Dialer. Reg Key exists)
3. Can this program help do it? (which mode resident/on fly, which extension to exe file and how to launch it (start-up or something else))
Many thanks in advance!
Thanks
Thanks a lot vidmabal, this is what I was looking for.
Cheers
Will this program work on an HD2 which i think uses a widcomm bluetooth stack??
dino_Donis said:
Will this program work on an HD2 which i think uses a widcomm bluetooth stack??
Click to expand...
Click to collapse
Really I don't know.
I am operating with service "BAG0:" ("Bluetooth Audio Gateway") - you can check if it is present in your system.
1. Launch Fdsoft Task Manager
2. Go into "Services" page.
3. Check that you have started service BAG0:
Alternatively you can check it in registry:
HKEY_LOCAL_MACHINE\Services\BTAGSVC
(Service name can differ, but "Prefix" value must be "BAG" and "Index" must be 0, "IsEnabled" value must be 1)