locked
converting audio stream to amr-nb format in windows store app RRS feed

  • Question

  • I want to compress my audio stream to amr-nb format to send to a network and also need to convert the receiving audio from amr-nb audio stream to pcm audio stream. How can it be possible with windows store app?
    Monday, November 11, 2013 10:44 AM

Answers

  • I think this can all be done but you'll need to convert the streams yourself using Media APIs in C++.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, November 11, 2013 8:19 PM
    Moderator

All replies

  • I think this can all be done but you'll need to convert the streams yourself using Media APIs in C++.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, November 11, 2013 8:19 PM
    Moderator
  • I have tried with the following code to capture as amr-nb audio stream:

    var capture = new MediaCapture();
    await capture.InitializeAsync();
    var recordProfile = new MediaEncodingProfile();
    Windows.Media.MediaProperties.AudioEncodingProperties audioProp= new AudioEncodingProperties();
    audioProp.ChannelCount = 1;
    audioProp.BitsPerSample = 16;
    audioProp.SampleRate = 8000;
    audioProp.Bitrate = 16;                   
    audioProp.Subtype = MediaEncodingSubtypes.AmrNb;                  
    recordProfile.Audio = audioProp;
    Windows.Media.MediaProperties.ContainerEncodingProperties containProp = new ContainerEncodingProperties();
    containProp.Subtype = MediaEncodingSubtypes.Mpeg4;
    recordProfile.Container = containProp;
    recordProfile.Video = null;
    var file = await KnownFolders.VideosLibrary.CreateFileAsync("captured.mp4", CreationCollisionOption.GenerateUniqueName);
    await capture.StartRecordToStorageFileAsync(recordProfile,file);

    But i got an exception : No Transform found for encoding or decoding.

    Could you please help me to find a solution? 


    Jameson M Tinoy


    Monday, December 2, 2013 4:37 AM
  • Hello Matt,

    Can you give some information about which Media APIs should use for Converting Raw Audio PCM audio stream to AMR stream?

    I stuck in my project and i need this information.

    please help me,

    Thanks

    Wednesday, December 17, 2014 9:02 AM