3

When I select audio as asset,I noticed Audio Asset track not found in selected asset. That "audio is created runtime as a file"(means created in application and saved in document directory).

I have used the code from link below ... its work when audio is selected as resources in project but not in my case (MY CASE: AUDIO IS CREATED IN APP AS FILE AND SAVED IN DOC. DIR.)

https://stackoverflow.com/a/12630437/1328096

Community
  • 1
  • 1
K'am
  • 129
  • 1
  • 7

1 Answers1

0

You can use this statement to check the sound of video

if([[songAsset tracksWithMediaType:AVMediaTypeAudio] firstObject]==NULL)
{
    NSLog(@"Sound is not Present");
}
else
{
    NSLog(@"Sound is Present");
    //You will initalise all things
    AVAssetTrack *sourceAudioTrack = [[songAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0];

}
Vaibhav Sharma
  • 1,123
  • 10
  • 22