본문 바로가기

Programming/Swift

Class: AVAudioPlayer

An object that plays audio data from a file or buffer.

 

Declaration

class AVAudioPlayer : NSObject

Overview

Use an audio player to:

  • Play audio of any duration from a file or buffer

  • Control the volume, panning, rate, and looping behavior of the played audio

  • Access playback-level metering data

  • Play multiple sounds simultaneously by synchronizing the playback of multiple players

For more information about preparing your app to play audio, see Configuring the Audio Playback of iOS and tvOS Apps.

Important

For more advanced playback capabilities, like playing streaming or positional audio, use AVAudioEngine instead.

 

developer.apple.com/documentation/avfoundation/avaudioplayer

 

Apple Developer Documentation

 

developer.apple.com

How to play a sound using Swift?

 

How to play a sound using Swift?

I would like to play a sound using Swift. My code worked in Swift 1.0 but now it doesn't work anymore in Swift 2 or newer. override func viewDidLoad() { super.viewDidLoad() let url:NSURL =

stackoverflow.com

 

'Programming > Swift' 카테고리의 다른 글

iOS: Tracking Visited Locations  (0) 2021.01.08
Article: Choosing the Location Services Authorization to Request  (0) 2021.01.08
Class: UIViewController  (0) 2020.12.21
MVVM Design Pattern  (0) 2020.12.19
[yagom] Swift - 클로저 고급  (0) 2020.12.15