How to concatenate 2 or 3 audio files in iOS?

后端 未结 7 1548
不知归路
不知归路 2020-12-08 12:19

I am newcomer in Objective-C and have experience only 5 months in iPhone development.

What I need:
I need to concatenate 2 or more

7条回答
  •  温柔的废话
    2020-12-08 12:53

    Have you tried something like this:

    AudioFileCreateWithURL //to create the output file
    For each input file:
        AudioFileOpenURL //open file
        repeat
            AudioFileReadBytes //read from input file
            AudioFileWriteBytes //write to output file
        until eof(input file)
        AudioFileClose //close input file
    AudioFileClose //close output file
    

    This would probably require that the input files are all the same format and would create the output file in that same format. If you need to convert the format, that might be better done after creating the output file.

提交回复
热议问题