I need to playback a single audio file with TheAmazingAudioEngine framework
and Swift
.
I'm completely newbie with this framework and tried the code below, but the audio didn't play. What is wrong? How could I play the audio file?
do {
var audioController = AEAudioController(audioDescription: AEAudioController.nonInterleavedFloatStereoAudioDescription())
let file = NSBundle.mainBundle().URLForResource("myaudiofile", withExtension: "wav")!
let channel = try AEAudioFilePlayer(URL: file)
audioController?.addChannels([channel])
channel.playAtTime(0)
} catch {
print("Failure")
}