How to show audio details when played using MediaPlayerLauncher? - windows-phone-7

In my application i am playing an audio file (let it be .mp3) using MediaPlayerLauncher. File is downloaded from network and stored in IsolatedStorage.
I managed to play the audio but it was a bit disapointing to see that there is absolutly no details about the played track.
Is there a way to show picture and/or track name when launched with MediaPlayerLauncher? Or am i forced to use MediaElement?

Unfortunately, if you're just playing an audio stream using the MediaPlayerLauncher there si no way to specifyu additional (meta) data for the launcher to also display.
If you want additional information displayed then you'll need to create the UI yourself and play the track via a MediaElement (or background audio).

Related

Core Audio code running on simulator mutes currently playing audio

Every time I'm working on a Core Audio application, specifically one that utilizes real-time audio via the remoteIO audio unit render callbacks, the moment I start the audio unit engine running whatever music I am playing via youtube or itunes is muted. I must reload the youtube page or reset my system preference audio settings to get sound back. Is there a solution to this?
Set the mix-with-others property on the Simulator's RemoteIO Audio Unit before starting it. Also enable a proper AVAudioSession category.

Can I set the track ids after the video is playing?

I'm trying to implement subtitles on a Chromecast Android app but I don't see a way to add the tracks after the media is already playing. Am I missing something or is that not possible? I'm pretty sure I've seen other apps doing it.
Thanks.
You cannot add tracks after a media is loaded; you need to either add the tracks before loading the media or add and then reload the media

How to download and save audio and video in wp7 mediaLiabrary?

Can you please tell me how to save or store sample audio and vidio into mediaLibrary.From my application if i long press on a picture i get a save picture option that saves the picture under saved pictures category in MediaLibrary. Similarly how do i save a mp3 and mp4 file.
I am able to downloadcontent and play the audio on emulator directly but not able to save any mp3 file from the web onto the MediaLibrary. Is there any other way to add songs to MediaLibrary?
Please Help me.
Thanks
The Windows Phone 7 API does not allow saving audio and video to the Media library, only on the isolated storage of the application itself.
This is in contrast to Pictures, which like you said you can save to the Media library.

Is it possible to grab a snapshot from a previously recorded video on Windows Phone 7?

I'd like to know if it's possible to grab snapshots from previously recorded videos. Those videos are recorded in the app itself.
By the way, I'd like to grab the snapshot from a video file saved in IsolatedStorage without having to play the video.
Is it possible? If so, how can I do it?
Cheers,
Rafael
I am not aware of an official platform feature to do this. However, if the video file is within your app's isolated storage, you might be able to:
Send the video to a server to do the processing
Add codecs/C# code to your app to process the raw MPEG4 frames.
Try using WriteableBitmap to capture a specific frame when using the media element. Since most media is handled in hardware, however, it is possible that the frame will be blank.
I solved the problem by creating the thumbnail while recording the video (captureSource.CaptureImageAsync()). To do that, I used the same instance of the CaptureSource I'm using to record the video.

On WP7, can I play a song from the library, interrupt it with a mp3 audio, and then resume the playback?

what I want to achieve is this:
Play background music from the media library
On a certain trigger, fade out the music, play another mp3 file (of various lengths, seconds up to a minute)
After that piece of audio is played, resume previous music from the library
Now I run into these constraints:
In order to access and play music from the user's library, I need to use the MediaPlayer XNA class.
In order to play an arbitrary mp3 file, I need to use either MediaPlayer or MediaElement, but not SoundEffect or SoundEffectInstance
If I play anything using the MediaElement, MediaPlayer stops. It completely loses the audio queue so I would need to play the remaining music which would be ok BUT
MediaPlayer doesn't support seek so I cannot open the previous song and just go the the position before it got paused
So:
I don't want to use SoundEffect or SoundEffectInstance as the audio would have to be wav files.
I can't use just MediaPlayer because if I played the audio there to interrupt the song I wouldn't be able to seek to its previous position
I can't use the combination of MediaPlayer and MediaElement as MediaPlayer stops the MediaPlayer which again prevents me from resuming previous playback
I can't just use MediaElement because it can't play songs from the library
Do you see anything I missed or is really the only option I have to suck it up and use wav files? (There would be many of these downloaded on the fly and it is just plainly inefficient this way!) Any suggestions?
Thanks!
Unfortunately you've hit a limitation of the platform.
In addition to the alternative you've identified you could play the music streamed from an external source through a MediaElement. By using a timer to keep track of how much has played, when resuming the track start that far through the track by including the start point in your request to the streaming server. This does of course mean you need to provide or find a suitable streaming capability. :(
Neither of these are ideal but for now that's the best we have. The background audio facilites coming in Mango may help but until details are announced we can't say for sure.
can't use just MediaPlayer because if I played the audio there to interrupt the song I wouldn't be able to seek to its previous position
You will get mediastatechanged event using MediaPlayer and inthat event you could check the state of the mediaplayer and Pause the Song and then you could also Resume the song

Resources