Objective-C - Playing sound with NSSound - Not working on Ubuntu Linux

192 views Asked by At

Ok I have GNUStep installed on both a Windows 7 machine, and an Ubuntu Linux machine. Using the EXACT same code, playing sound works under GNUStep on windows, and does absolutely nothing on Linux. I have scoured google, stackoverflow, etc and found NOTHING. I hate that I have to use NSSound on anything but Mac, but I don't have a choice. Has ANYONE got NSSound to work with Linux??

NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"Narnia" ofType:@"wav"];
sound = [[NSSound alloc] initWithContentsOfFile:resourcePath byReference:NO]

[sound play]
  • Restricted-Extras are installed on linux
  • '$aplay Narnia.wav' plays just fine
  • The application can't even get info about the wav file like its duration when I open it, unlike in windows
0

There are 0 answers