How to retrieve the extension of music file in Windows Phone 8.0 using C# code? By extension I mean MP3, MP4, OGG etc.
Below is my code to get the songs from the music library:
MediaLibrary lib = new MediaLibrary();
SongCollection col = lib.Songs;
You cannot do that. SongCollection is basically an IEnumerable of Song and the Song class only contains Name, Artist and Album according to the documentation.
Related
How can we convert audio in WP 8.1 from one format to another in a Memory Stream?
Ex. convert MP3 file to WAV (PCM).
I checked the following:
NAudio is not yet supported on WP 8.1.
The Media Foundation just supports a subset of APIs, and cannot be used for converting from one format to another.
Appreciate your help.
Did you try out the MediaTranscoder class for the conversion?
Reference: Compress wav file to wma on Windows Phone 8
I have a problematic situation that I wish to expose you because it contains some opposites constraints. Maybe someone will have an idea on how to unlock my problem.
I'm going to make a mobile application with ActionScript 3 and Air for iOS and Android. This application has to download zip file which it uses to display text, bitmap and sound.
This last one is the problem.
After some research, one of the best way I found to check a zip file is FZip, but it allows us to get data from zip on a ByteArray form. And a Sound can't be converted from ByteArray. ( That's what a lots of results about it appear to say. )
One of the solution proposed is to put the ByteArray of a sound and put it in a SWF. Then take the SWF from the zip to get the Sound.
I can't do that because this zip will be uploaded from a admin interface used by anybody. I can't force them to use Flash.
I have few potential direction where I ask for your advices :
• Use Code or Native Extension ( iOS and Android ) to check a zip without files read in ByteArray
• Convert a ByteArray into Sound without have to pass it in a SWF
• Dynamicly create a SWF with the ByteArray of a Sound
• In the last possibility, another way to drag and download few files together which can be consulted in another format than ByteArray ( Like a iOS Bundle but with android too )
Thanks a lot to help me,
You can simply write the ByteArray on a local mp3 (or mp4) file and then play it, to write a ByteArray to file see documentation here.
I need to add Microsoft.Xna.Framework.Media.Song from MediaLibrary into Microsoft.Phone.Scheduler.Alarm. It requires an uri to the song. But there is no 'uri' field in the Song class. What can I do?
I assume, that your song is in your application's package (included in project files). Then you can directly create an Uri to this MP3 file, without needing to deal with the XNA's Song class.
Example:
alarm.Sound = new Uri("/Assets/MyAlarm.mp3", UriKind.Relative);
I assume here, that your MP3 file is included in the Assets folder and has build action set to Content.
Please note, that only MP3, WMA and WAV are allowed. Also, you can't play sounds from Isolated Storage, they must reside inside your project.
When I record video using a Webcam, it gets recorded as an .flv file in the streams folder of the app that I'm using. Eg - path/to/red5/webapps/vod/streams
I want to create a directory in streams and store the file there. How can that be done?
Just append folder name at the end of the server url of netconnection object.
var folder_name = "yourfolder";
var netConnection=new NetConnection;
netConnection.connect(serverUrl+folder_name);
Then your recordings will be saved into the location streams\yourfolder.
In your case path/to/red5/webapps/vod/streams/yourfolder
Hope this helps.
It it possible to merge sound captured from microphone with an mp3 file selected and save as a new mp3 file in windows phone 8?
Does naudio have wp8 support??
Possible, yes. But you would have to decode the mp3 file into raw PCM data that matches the waveformat of the captured audio data, merge the pcm data (either an additive or mean merge or you'd simply add the captured audio data to the end of the pcm data from the mp3) and encode your new pcm data to MP3. There are plenty of libraries out there that support encoding/decoding of mp3 data and you might even find one that would let you decode/re-encode only the sub-sample of the mp3 file that you're interested in merging with captured audio data.
NAudio has, AFAIK, no WP8 support. I believe that they're currently working on Windows Store App support.
You would need to use WASAPI - which is a native-only API - or the Microsoft.XNA.Audio.Microphone-class to capture data.