1

in iOS Application i do this with the following code

inputNode = audioEngine.inputNode

        let bus = 0

    inputNode!.installTap(onBus: bus, bufferSize: 2048, format: inputNode!.inputFormat(forBus: bus)) {

            (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in

            let firstChannel = buffer.floatChannelData?[0]
            let arr = Array(UnsafeBufferPointer(start: firstChannel, count:Int(buffer.frameLength))) 
    self.array.append(contentsOf: arr)
    audioEngine.prepare()

        do{
            try audioEngine.start()
        }catch {
            print("audioEngine start failed")
        }

and now i want to do this in my Watchos3 application but the inputnode is not available on watchos3..... what can i do, to get the real microphone data(Float)?

Osman
  • 1,496
  • 18
  • 22

1 Answers1

0

Have you set your AVAudioSession category to either AVAudioSessionCategoryRecord or AVAudioSessionCategoryPlayAndRecord and activated the session?

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159