Play a media file which is stored in isolated storage space..  
Author Message
raj.ramesh





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

How can I Play a media file which is stored in isolated storage space.....

Regards

RR


.NET Development2  
 
 
rauhanlinnake





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

I suppose that just like from any other stream, open the file from isolated storage using IsolatedStorageFileStream, and play the file using that stream. Since you have not tell that kind of file this is, i can't help you further.

If you have a wav file in isolated storage, you can play it with SoundPlayer class. Beware that following code is totally untested by me, but should give you some idea:

IsolatedStorageFile isol = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream stream = new IsolatedStorageFileStream("filename.wav", FileMode.Open, isol);

SoundPlayer player = new SoundPlayer(stream);
player.PlaySync(); //use Play() in real application


 
 
raj.ramesh





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

We Are using .net Framework 1.1.

Sound Player Class does not exists in This Version..

Please give me the idea..

 
 
RizwanSharp





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

We Are using .net Framework 1.1.

Sound Player Class does not exists in This Version..

Please give me the idea..

You can use Native API PlaySound in winmm.dll using P/Invoke!

Here is signature and right usage of it:

http://www.pinvoke.net/default.aspx/winmm.PlaySound

I hope it'll help!

Best Regards,



 
 
raj.ramesh





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

It just play a single sound...

But I need to play the full media file...

 
 
RizwanSharp





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

It just play a single sound...

But I need to play the full media file...

What do you mean by this As far as you have a media file in wav format i.e wth *wav extentions PlaySound() can handle it and the SoundPlayer class in .Net 2.0 is wrapper on the same API. So i cant see any problem even if you have a wav file of 5mb to play using PlaySound()!

Best Regards,



 
 
Peca55





PostPosted: .NET Base Class Library, Play a media file which is stored in isolated storage space.. Top

Note: Google BASS library, it will play any streamable audio ( wav,mp3 etc.) and there is stable .NET versions for Windows and Mac OS, so your code works in currently .NET supporting platforms ( maybe this is true for Linux yoo). Don't use Windows specific P/Invoke, because Windows maybe, say 'Blackhorn' version about 2014 (successor to Longhorn), don't support it anymore!

One source and starting point is

BASS

BASS is an audio library for use in Windows and Mac OSX software. Its purpose is to provide developers with the most powerful and efficient (yet easy to use), sample, stream (MP3, MP2, MP1, OGG, WAV ...

P.S. download Win or Mac version from top of page, then ftom Other API section .NET 1.1 or .NET 2.0 , plus any add-on of interest