Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. (audioSource, audioCount) = soundFileSelect(audioFileIndex: 0)
  2. audioSource?.isPositional = true
  3. if vol {
  4. audioSource?.volume = 1.0
  5. }
  6. else {
  7. audioSource?.volume = 0.0
  8. }
  9. let audioPlayer = SCNAudioPlayer(source: audioSource!)
  10. geometryNode.addAudioPlayer(audioPlayer)
  11. let play = SCNAction.playAudio(audioSource!, waitForCompletion: true)
  12. let loopPlay = SCNAction.repeatForever(play)
  13. geometryNode.runAction(loopPlay)
  14.  
  15. audioPlayer.audioNode?.engine?.mainMixerNode.outputVolume=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement