通过使用以下代码,我通过按下按钮成功播放了声音。但是,我想按下一个按钮并循环/无限地播放该声音。这是如何实现的?我也想实现暂停/播放功能。提前致谢。
@IBAction func keyPressed(_ sender: UIB`utton) {
playSound(soundName: sender.currentTitle!)
}
func playSound(soundName: String) { //
let url = Bundle.main.url(forResource: soundName, withExtension: "wav")
player = try! AVAudioPlayer(contentsOf: url!)
player.play()
} // End of Play Sound
Run Code Online (Sandbox Code Playgroud) 我刚开始使用PyCharm作为我的Python IDE.在我打开一个新的.py文件时,我必须转到Code - > Configure Current File Analysis ...,然后将每个.py文件的突出显示更改为语法(首选项).
有没有办法在默认情况下自动为每个文件更改此项?
顺便提一下stackoverflow上的第一篇文章.
谢谢!