OpenWatch / FFmpegWrapper

A lightweight Objective-C wrapper for some FFmpeg libav functions
Other
179 stars 54 forks source link

opus file to mp3 - opus codec not supported in WAVE format. #19

Open Aviv1236 opened 7 years ago

Aviv1236 commented 7 years ago

I try to convert opus file to mp3/wav file

But I get this error: opus codec not supported in WAVE format. for example I can

  1. convert opus file to ogg but not for mp3/wav
  2. convert mp3 file to wav file

My code, can you please advise what I am do wrong?

Thanks override func viewDidLoad() { super.viewDidLoad()

    input = Bundle.main.path(forResource: "example", ofType: "opus")

    let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]

    output = documents.appending("/result1.wav")

    self.convertAudio()

}

func convertAudio(){

    self.ff.convertInputPath(input, outputPath: output, options: nil, progressBlock: { (bytesRead :UInt, totalBytesRead : UInt64, totalBytesExpectedToRead : UInt64) in

        print("OK")
    }) { (value, error) in

        print(error ?? "")

    }

}
Aviv1236 commented 7 years ago

?