7

I'm trying to play an aiff file using SKAction. This code results in white noise being played in the simulator and on my iPod :

SKAction *sound = [SKAction playSoundFileNamed:@"noise1.aiff" waitForCompletion:NO];
[self runAction:sound];

The sound file is valid, it works when I use the Amazing Audio Engine. Anyone know what's wrong?

Thanks

Typo Johnson
  • 5,974
  • 6
  • 29
  • 40
  • the encoding may not meet the expected standards, or the file may be saved in a nonstandard format, or nonstandard features ( some apps add tags and other metadata). Try other encoding options and formats (caf, wav). – CodeSmile Jan 11 '14 at 12:18
  • Thanks. Yes caf files work but I've got hundreds of aiff files, I could convert them as a batch but I've discovered how easy AVAudioPlayer is so I'm using that instead. Plus it lets me stop the noise during playback which I need. – Typo Johnson Jan 11 '14 at 17:02
  • This shows how to get AVAudioPlayer working : http://stackoverflow.com/questions/8016765/avaudioplayer-not-playing-any-sound – Typo Johnson Jan 11 '14 at 17:04

3 Answers3

5

Just faced with the same issue.

These settings helped me:

enter image description here

Andrey Gordeev
  • 30,606
  • 13
  • 135
  • 162
1

I use Adobe Audtion to cut up sounds. I also hit the same 'whitenoise' problem as well.

The issue was that the *.aif files there were being created, some had been saved with an Audio bit depth of 16.

Re-saving them at 32 (See answer by Andey) resolved the issue. Sample rate (44100 hz) had no influence on whether there was 'white noise' or not.

Tim
  • 3,434
  • 1
  • 14
  • 13
1

Always used Audacity to produce my sound effects until discovering now that SpriteKit's SKActions don't like 16bit .aiffs and play them at a very low tempo which comes-out sounding like white noise as described in the question above (Whereas the same sound files play just fine with AVAudioPlayer). Audacity has no option for exporting aiffs at 32 bit so my solution was so switch to using good old wavs (exported at 32bit) and the sounds now play fine in SpriteKit SKActions.

Geoff H
  • 3,107
  • 1
  • 28
  • 53