Media engine error, not hearing sound on local machine - c#

When I try to play a sound with a media element on my local machine I can't hear any sound. But I can hear sound in the simulator(same thing almost right?) and on my surface when I test it on there. It Doesn't work on all my pages too not just one on the local machine only too.
load event goes off in simulator but not in local machine. Also stream isn't null.
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Sound/" +selectedCharacterSets[currentCharacterSet].character[currentCharacter].romaji + ".mp3", UriKind.Absolute));
var stream = await file.OpenAsync(FileAccessMode.Read);
mdeSound.SetSource(stream, file.ContentType);
Media failed event going off. Error: MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT 0x8000FFFF. Does anyone know how to fix this and why its only on local machine?
EDIT: converted mp3 to wma... still doesn't load. converted it to wmv now it plays on local machine... why? I'm still confused. Opening the mp3 in the music app throws an error too, windows media player plays it fine.

There is an issue with the file you are trying to play. This could be because of DRM or because of bitrates being too high, etc. Windows 8 Pro can play more codecs than Windows 8 RT, but you said it worked on your Surface which is interesting. Try using Audacity or another program to save it as a lower bitrate MP3 or even a basic .WAV file.
It's also interesting that you couldn't play it as WMA but you could as WMV. WMV is video while WMA is audio. You may have a corrupt media stack on your machine.
P.S. The simulator essentially uses Remote Desktop, so there is a difference in how the audio gets played.

Related

How to add a Wav file to Windows Form Application in Visual Studio

I was publishing my first C# Windows Form Application with a built-in audio player (I used System.Media), but when I tried to run the program on another PC of mine, it returned an exception and then crashed every time I click on the button to play audio so I was wondering if there was a way to play the audio on another PC without crashing.
Here's the code part I used to play the sound:
System.Media.SoundPlayer player = new System.Media.SoundPlayer("mouse_click.wav");
player.Play();
Then the PC I used to run the program returned this error: verify that the audio file path is correct.
Thank you everyone for the help!
If you want to add a Wav file to Windows Form Application, you can refer to the following steps:
First, add the Wav file in the Resources File (Project>Properties>Resources):
Second, refer to the following code to play the Wav file in VS:
System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources._15035);//Use your own filename in place of _15035
player.Play();

Stream rtsp video using axvlcplugin to a file

I am using VLC plugin to run an rtsp stream. The stream works good. But I want to store these videos to a file destination. I use this code but does not work.
axVLCPlugin21.playlist.add("rtsp://192.168.10.222:554/h264", null, ":sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\\123.ogg,no-overwrite} :sout-keep");
axVLCPlugin21.playlist.play();
This code only plays the rtsp stream but does not store. However, the same options can be used to stream directly on the VLC player.
Try using this Option for Storing Videos and displaying videos simultaneously
original commad to play in vlc
%vlc path% vlc.exe -vvv rtsp://192.168.10.22:554/h264 :sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=C:\\\\123.mp4},dst=display}:sout-keep
if this works try to use
:sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=C:\\\\123.mp4},dst=display}:sout-keep
":sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\123.ogg,no-overwrite} :sout-keep
also try to work in VLC gui by using streaming option+displaylocally+dst=file
Refrence:HowTo Receive and Save a Stream
VLC does not support recording of streams via plugin. Check this Link
I got a work around for it. I record the stream by calling the VLC directly. However, the player is hidden. I use this code:
Process.Start("C://Program Files//Videolan//VLC//VLC.exe","\"rtsp://xxx.xxx.xxx.xxx:554/h264\" --qt-start-minimized --sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\\123.ogg,no-overwrite}");

Recording Video from IP camera using VLC?

i am try VLC media player to record a video from IP camera. i found this command line to record video from ip camera.
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 :demux=dump :demuxdump-file=C:\output_test.avi vlc://quit
The command line is working, i can get video with sound from IP camera. The only problems is the recorded video only can be played using VLC itself, the video also only have information which is only size(KB,MB), the windows cannot get the other information such as video length, size(Width*Height), etc. And the most important is video cannot be played using Window Media Player.
**EDIT
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 --sout "#std{access=file,mux=avi,dst="c:\test.avi"}" vlc://quit
using this command, now i got all the video's info and playable using window media player and other players as well, but this time the there is no sound in video.
I'm implementing this in web app. I got the code running fine.
Does anyone here can provide me the correct command line to get working video with sound and also video's information.
i tried searching but cannot find the correct command line(if any). Tried VLC forum but got Error 403.
**note: i am using windows 7 OS.
try transcoding & mux
vlc.exe -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 :sout=#transcode{vcodec=h264,vb=1024,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=avi,dst="c:\test.avi"}

windows phone 7 Download files and save it in phone storage

am developing an application which can fetch files from internet.. how do i download and save a "docx" or "wav" file from internet within the application and use it later with other application likes office or windows media player.
You can download files in the background (ie. they will continue even when your application is not running).
Having said that, you should research the types of files you need to support. For example, you can play an audio file (if the format is supported) or add it to Music hub but you cannot open a file in Office. Very few filetypes can be integrated with, so do some research before you start writing your app otherwise you might be disappointed.
place an image control in your page. here im1 is controls name.
it is working for me
string imgurl="http://.........";(path)
Uri addrs=new Uri(imgurl,UriKind.Absolute);
BitmapImage bitmap = new BitmapImage(addrs);
im1.Source = bitmap;

Play audio url on windows mobile

I'm going to write a function to play a mp3 file from an URL on Windows Mobile 6.0 without downloading all the stream to mobile. I read some documentation and faced some problem that.
Using NAudio.dll
: The dll is not compatible for Windows Mobile
Using DirectShowLib.dll : have not found way to get from audio stream.
Is it true that we can't get an audio Url Stream in Windows Mobile 6.0? Is there any way or any dll else to help me?
Which windows mobile? 6.5 or 7?
7 uses Silverlight so it should be really easy to do smooth streaming (never tried it).
6+ I'm not so sure, maybe use a WCF filestream to get the stream?
I find out Bass library work well on my specific issue - play mp3 audio from url on windows mobile 6.
Add bass_cp.dll to your solution. And make sure to copy the bass.dll to your execute directory.
And what you need to do is very simple:
int stream = Bass.BASS_StreamCreateURL(strUrl, 0, 0, null, IntPtr.Zero);
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
Bass.BASS_ChannelPlay(stream, false);
Of course after you register for the dll. Then add this code line at first:
BassNet.Registration(string email, activated key);

Categories

Resources