Ich bin etwas ratlos, da laut Konsole alles okay ist - aber zu hören ist leider nichts. Ich möchte einen Ton abspielen, den ich zuvor ins Projekt gezogen habe:
Alles anzeigen
Ich habe bereits verschiedene Sounddateien und Formate getestet, ohne Erfolg.
Woran kann das liegen?
Quellcode
- func playSound(){
- var audioPlayer = AVAudioPlayer()
- var callSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("codecopen", ofType: "wav")!)
- println(callSound)
- var error:NSError?
- audioPlayer = AVAudioPlayer(contentsOfURL: callSound, error: &error)
- audioPlayer.prepareToPlay()
- audioPlayer.play()
- }
import AVFoundation
habe ich bedacht.Ich habe bereits verschiedene Sounddateien und Formate getestet, ohne Erfolg.
Woran kann das liegen?