I'm facing a very odd problem here, it seems like reducing or any action taken on the Volume property of the MediaPlayer static class doesn't make any difference. I've heard somewhere that microsoft protected it but it doesn't make any sense that in iPhone & Android you can do it, but in windows phone 7 it's impossible.
MediaPlayer.Volume = 0.2F;
what am i doing wrong?
Thanks!
You can't control the phone's global volume. Actually it makes difference, you just haven't notice it - it behaves as a scale for your music, so this goes like this:
System sound * MediaPlayer.Volume * What you are playing.
One does not simply look into MSDN: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.media.mediaplayer.volume.aspx
Related
Ideally I would want to define my own Device for in the Simulator. Let's say 2000w x 500h.
Anybody know of any way to accomplish this?
You might be wondering, "why does he want to do that?" It's for prototyping, a non standard sized screen.
Some directions, but not sure if they can work:
unlocking the aspect ratio of window resizing
creating an own device
changing the sizes of one of the existing devices
I am almost done developing my first game for the Windows Phone 7 OS. Unfortunately, I've ran into a rather nasty problem. A simple task of just playing background music and a sound effect at the same time creates a serious distorsion in the sound effect play and the overall result is awful. This is when the sound comes out of the phone's speaker.
If, however, I use the headphones, all the problems go away (i.e., no distorsions whatsoever). I am also using the same code on an HTC HD7 and I don't see the problem either on the speaker or on the headphones.
The sound effect is an MP3 # 48kbps and the music is also an MP3 # 96 kbps.
All I do is the following:
In the LoadContent:
backgroundMusic = Content.Load<Song>("Music");
soundEffect = Content.Load<SoundEffect>("SoundEffect");
soundInst = soundEffect.CreateInstance(); / I am using a SoundEffectInstance to play the sound effect
MediaPlayer.Play(backgroundMusic);
MediaPlayer.IsRepeating = true;
Laster on, I just issue a soundInst.Play().
If, however, I do not play any music, the sound effect plays just fine.
Again, this only seems to happen on my Nokia Lumia 800 as it seems ok on the HTC HD7. However, the funny thing is that in the majority of the games that I play on the Lumia 800, I am not noticing this music/sound effect problem (I've only noticed it in one other game).
I have tried to play w/ the volume as well but it doesn't help. Even if the music has a volume of 0, the sound effect is not played correctly.
In conclusion, if and only if I stop the music from playing completly, regardless of the volume, the sound effect plays correctly.
Any ideas?
Thanks in advance!
I wrote a custom Music player using the interface MediaPlayer and SongLibrary. However, when I try to change the volume of the music played, I cant hear the change in volume. I have used a slider as a volume control and wrote the following code to change the media volume:
The slider values are initialized as follows:
slider1.Minimum = 0; //maps to wp7 volume 0.0
slider1.Maximum = 10; //maps to wp7 colume 1.0
slider1.Value = 8; //maps to wp7 default volume 0.85
The volume change code is as follows:
private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
MediaPlayer.Volume = (float)((slider1.Value)/10.0);
}
Even if I hardcode the volume to 0, I can hear the music.
This is tested on WP7 SDKv7.1
Is this a bug in the SDK?
It is my understanding that this is a hardware bug with HTC WP7 devices. Volume will work correctly in the emulator as well as non-HTC phones.
There's three things to keep in mind when trying using the MediaPlayer.Volume property:
It doesn't work if you play a song from zune (stored in the Musique & Videos hub of the phone). Only for your app's custom musics.
You have to set the Volume property after starting the music. It will be ignored if you do it before
There's a few known bugs on the emulator. When it doesn't work, always try once on the device to make sure
We are developing a XNA game with high interactivity. The game includes some background music.
We are trying to play the background music through the MEdiaplayer.play method. But this seems to block the smooth gameplay for a while. How can this be overcome?
Had tried using the soundeffect instance for this initially and it worked fine. But that approach doesn't seem to go well with the certification requirements. Pls help
Thank You
I think this is normal for large music files. You could however try to put
IsFixedTimeStep = false;
after
TargetElapsedTime = TimeSpan.FromTicks(???);
I have found that that makes a smoother gamepay. At least back in 7.0 - but I still use it.
I of course assume that you use elapsed time for all animations.
There is a rotary control I have seen that is like the edge-on view of a knurled volume control wheel on an old Walkman.
Without knowing what it's called I can't search for it - I'm pretty sure that the app was based on Qt.
Edit - having tried it on a couple of people younger than me it seems that the iPod generation don't know volume knobs! Looks like I need to use up-down arrows instead (it's not actually a volume it's a rotate view)
"edge of a knurled volume control" sounds like the QwtWheel to me.
Is it QwtKnob?
Check the gallery here http://www.digitalfanatics.org/e8johan/projects/widgets/
sounds like volume control