Question

I need to take an .aac audio file (Advanced Audio Coding), and programmatically extract a 10 second clip from the middle into a new .aac file using C# from a Windows Azure worker roll.

I found this article by Mark Heath which explains how a WAV file can be trimmed using NAudio, but I'm not sure how I'd do the same for an AAC file, decoding and encoding the file will lower the quality right?

I also came across Azure Media Services but I'm also struggling to see if that is anything like what I need, it looks like it might not support trimming audio.

I found the MediaTranscoder class available in windows store apps which might be able to do what I want (see this sample project that can trim videos) but can I access this API from an azure worker roll, and could it do what I want if I could?

Was it helpful?

Solution

Please begin with the overview of the service at http://www.windowsazure.com/en-us/develop/media-services/, get familiar with how to upload assets and create encode jobs. In your case, you would need to download the sample code, build and run it.

Then, for trimming, you would submit jobs where the preset to the Windows Azure Media Encoder would specify your time interval as a , for example:

<Sources>
  <Source
    AudioStreamIndex="0">
    <Clips>
      <Clip
        StartTime="00:00:00"
        EndTime="00:00:09.9740000" />
    </Clips>
    <CaptionFiles />
  </Source>
</Sources>

I can explain further details for exactly how to build the presets, but please also confirm that you know the exact in and out points you want to trim, in time format (HH:MM:SS.MMM)?

OTHER TIPS

Is your source file an elementary stream (i.e. raw AAC bits, and not wrapped in a container such as MP4)?

Azure Media Services can potentially be used if your content were wrapped in MP4.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top