Home How to set Audio streaming URL as AVAudioFile?
Reply: 0

How to set Audio streaming URL as AVAudioFile?

user916
1#
user916 Published in June 21, 2018, 4:40 am

I am following this tutorial :https://miguelsaldana.me/2017/03/13/how-to-create-a-soundcloud-like-waveform-in-swift-3/

My code given below .There is an exception :

Error Domain=com.apple.coreaudio.avfaudio Code=2003334207 “(null)” UserInfo={failed call=ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)}

   let file = try! AVAudioFile(forReading: AudioLink)  //Got Exception Here

    let format = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: file.fileFormat.sampleRate, channels: file.fileFormat.channelCount, interleaved: false)
    print(file.fileFormat.channelCount)
    let buf = AVAudioPCMBuffer(pcmFormat: format!, frameCapacity: UInt32(file.length))
    try! file.read(into: buf!)



    //     print("floatArray \(readFile.arrayFloatValues)\n")
    //self.waveFormView.setNeedsDisplay()
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316841 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO