Questions tagged [skaudionode]

32 questions
12
votes
2 answers

SKAudioNode() crashes when plugging in/out headphones

I am using a SKAudioNode() to play background music in my game. I have a play/pause function and everything is working fine until I plug in my headphones. There is no sound at all and when I call the pause/play function I get this…
Cherrypig
  • 370
  • 1
  • 2
  • 12
7
votes
1 answer

How to use SKAudioNode

I found out SKAction playSoundFileNamed does memory leak in IOS 9: https://forums.developer.apple.com/thread/20014 They recommend to use SKAudioNode, but the example is swift and i use objective-c in my project. Example: func testAudioNode() { …
TeKo
  • 97
  • 1
  • 3
5
votes
0 answers

Creating an SKAction extension for SKAudioNode

I have decided to break off my very painful relationship with SKAction.playSoundFileNamed and move on to using SKAudioNodes in our project -- the breaking point was their being totally broken by interruptions without any consistency. We are trying…
5
votes
4 answers

Initializing SKAudioNode using fileNamed returns nil

This is the first time I use SKAudioNode. First I declared a property at the top of my GameScene class: var backgroundMusic: SKAudioNode! Now I added a helper method: func playBackgroundMusic(name: String) { if backgroundMusic != nil { …
Tom Shen
  • 1,838
  • 3
  • 19
  • 40
4
votes
2 answers

SKAudioNode not load sound from url

I want download sound from url and play it once: let sound = SKAudioNode(url:URL(string:"http://www.music.helsinki.fi/tmt/opetus/uusmedia/esim/a2002011001-e02-16kHz.wav")!) sound.run(SKAction.play()) I tried .mp3 music too. It doesn't download…
Arti
  • 7,356
  • 12
  • 57
  • 122
4
votes
1 answer

SKAudioNode Crash: AVAudioPlayerNode.mm:333: Start: required condition is false: _engine->IsRunning()

I've a simple SKAudioNode: let backgroundSound = SKAudioNode(fileNamed: "backgroundSound.mp3") I use to play backgroundSound.runAction(SKAction.play()) and backgroundSound.runAction(SKAction.stop()) to stop. Everything works fine until the app did…
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
3
votes
0 answers

IOS App crashing due to "too many files open" error possibly coming from incorrect use of the SKAudioNode

My app crashes when I try to play a sound (repeated). I can play the app for about 3 minutes before it crashes and when I remove the audio Nodes, the app does not crash and the memory usage stays relatively constant. I attach the audio node to an…
3
votes
1 answer

How to use/implement pause() to pause a SKAudioNode?

The documentation: pause() Creates an action that tells an audio node to pause playback. Declaration class func pause() -> SKAction This action may only be executed on an SKAudioNode object. The audio is paused, and if restarted, resumes at where…
Confused
  • 6,048
  • 6
  • 34
  • 75
2
votes
0 answers

SKAudioNode problem after App going down, restart, is this a bug?

I have a problem with the SKAudioNode. The game ends with the Home Button. An audio file will be played. When I return, the audio file will continue to play. I want to stop it. I have tried many things but without…
Roman
  • 29
  • 4
2
votes
1 answer

Is there an isPlaying() equivalent for SKAudioNode?

I am experimenting with other sound effect options for our game after determining SKAction.playSoundFileNamed is not only buggy and leaky but also creates a crash specifically during IAP interruptions (not OK, Apple). We are attempting to use…
2
votes
0 answers

Issue with copying an SKAudioNode object

I am currently preloading sound effects in a dictionary, as such: soundEffectsDictionary[SoundEffectType: SKAudioNode] Doing this allows me to preload all the sound effects in the game, and request a sound effect as needed. I am simplifying this…
MikeL
  • 163
  • 10
2
votes
0 answers

SKAudioNode doesn't fade volume with duration

I've tried to fade volume of a SKAudioNode to 0 with duration, but the duration doesn't seem to affect, the audio stops immediately: let fireAudio = SoundManager.sharedInstance.fire //SKAudioNode let stopAudio = SKAction.stop() let…
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
1
vote
0 answers

SKAudioNode is THROWING and it never did before updating Xcode 13.4

I coded a fully operational video slot machine that ran perfectly prior to updating recently to Xcode 13.4. Now, SKAudioNode is causing trouble. It used to work without problems, but now, the first use of SKAudioNode anywhere in my code gives a…
Rick
  • 11
  • 1
1
vote
0 answers

iOS 13 Crash SKAudioNode with autoplay deactivated

Since iOS 13 my App crashes on view.presentScene(scene) (EXC_BAD_ACCESS (code=EXC_I386_GPFLT)). This only happens, if the scene has a SKAudioNode with autoplay deactivated. The error can be reproduced by creating a new Project->Game with SpriteKit.…
Jesse
  • 370
  • 2
  • 12
1
vote
1 answer

SKVideoNode stoping an SKAudioNode from playing

I'm trying to add background video and background music to a game I'm creating. To do this I'm creating a SKVideoNode and a SKAudioNode. When I run the game the video plays fine but most of the time the music doesn't play. It works just fine though…
Standard
  • 45
  • 6
1
2 3