问题
I am looking to encode a wav file in wma (or mp3, ogg, etc) on Windows Phone. I have not found any resources online. Any ideas on how I can archive this?
I am trying to record a voice from the microphone and upload it from the phone. That's why I prefer to compress the audio file before sending it.
回答1:
Starting from Windows Phone 8.1, you can use MediaTranscoder class for that.
Also, since WP 8.0 you can use AudioVideoCaptureDevice to record directly into the compressed format. Unfortunately for you, neither MP3 or WMA is supported with this method, but you can choose between AAC and AMR codecs. Here's a sample code.
来源:https://stackoverflow.com/questions/25487256/compress-wav-file-to-wma-on-windows-phone-8