Record, pitch, and play live audio on iOS

I'm just wondering if someone can explain to me how I will record the sound by modifying it (step?) And playing it for the user on the iPhone.

I am not asking anyone to do this for me, just a few tips on how I should do this. looking through documents, it seems that I should use AVAudioSession, AVAudioRecorderand AVAudioPlayer( AVFoundation.Framework) for parts reproducing reproduction. Or should I use CoreAudio.Framework? and then the question arises of changing sound.

+3
source share
3 answers

OpenAL - , , . iPhone, , , . .. :

alSourcef(source, AL_PITCH, pitch);

, AVFoundation CoreAudio - .

0

AVAudioUnitTimePitch .

udacity.com iOS Swift:

func playAudioWithVariablePitch(pitch: Float) {
    audioEngine.stop()
    audioEngine.reset()

    let audioPlayerNode = AVAudioPlayerNode()
    audioEngine.attachNode(audioPlayerNode)

    let changePitchEffect = AVAudioUnitTimePitch()
    changePitchEffect.pitch = pitch
    audioEngine.attachNode(changePitchEffect)

    audioEngine.connect(audioPlayerNode, to:changePitchEffect, format:nil)
    audioEngine.connect(changePitchEffect, to:audioEngine.outputNode, format:nil)

    audioPlayerNode.scheduleFile(audioFile, atTime:nil, completionHandler: nil)
    try! audioEngine.start()

    audioPlayerNode.play()
}
+2

. DIRAC-mobile, . , .

0

Source: https://habr.com/ru/post/1779294/


All Articles