var filePath = NSBundle.mainBundle().pathForResource("movie_quote", ofType: "mp3"){
var filePathUrl = NSURL.fileURLWithPath(filePath)
audioPlayer = AVAudioPlayer(contentsOfURL: filePathUrl, error: nil)
audioPlayer.enableRate=true
with this code
1
File -> add new file -> select audio file -> move to "supporting files " on Navigator.
the file is located to "movie_quote"
2,
@IBAction func FastButton(sender: UIButton) {
audioPlayer.stop()
audioPlayer.rate = 2.0
audioPlayer.play()
rate enable to change the pitch.
today's Udacity's lecture.
No comments:
Post a Comment