Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (audioSource, audioCount) = soundFileSelect(audioFileIndex: 0)
- audioSource?.isPositional = true
- if vol {
- audioSource?.volume = 1.0
- }
- else {
- audioSource?.volume = 0.0
- }
- let audioPlayer = SCNAudioPlayer(source: audioSource!)
- geometryNode.addAudioPlayer(audioPlayer)
- let play = SCNAction.playAudio(audioSource!, waitForCompletion: true)
- let loopPlay = SCNAction.repeatForever(play)
- geometryNode.runAction(loopPlay)
- audioPlayer.audioNode?.engine?.mainMixerNode.outputVolume=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement