• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
problems loading a sound with NSSound
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems loading a sound with NSSound


  • Subject: problems loading a sound with NSSound
  • From: "Jonathan Chacón" <email@hidden>
  • Date: Mon, 8 Mar 2010 05:26:23 +0100

Hello,

I added a sound file to the resources of my project ( logoSound.AIF )

I use this function to load the resource:

-(NSSound*) getSound:(NSString *) sndValue {
	NSBundle *bundle = [ NSBundle bundleForClass: [ self class ] ];
	NSString *sndName = [ bundle pathForResource: sndValue ofType: @"aif" ];
	NSSound *sound = [ [ NSSound alloc ]
					  initWithContentsOfFile: sndName ];
	return sound;
} // getSound


I do this to load the sound file:

NSSound *logoSound = [self getSound: @"logoSound"];

I try:
[logoSound play];

but the sound doesn't play


what happend?


thanks




Regards
	Jonathan Chacón Barbero
   Accessibility, usability and new technologies consultant

Phone: +34 679953948
e-Mail: email@hidden
Blog: http://programaraciegas.weblog.discapnet.es
Twitter: http://www.twitter.com/jonathanchacon
LinkedIn: http://es.linkedin.com/in/jonathanchacon
Facebook: http://www.facebook.com/jonathan.chacon.barbero
Messenger: email@hidden
Skype: Tyflos_
Ping for iPhone: jchacon

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: problems loading a sound with NSSound
      • From: "James W. Walker" <email@hidden>
  • Prev by Date: Bypassing action method in NSSegmentedControl
  • Next by Date: Transparent background for controls - some problems
  • Previous by thread: Bypassing action method in NSSegmentedControl
  • Next by thread: Re: problems loading a sound with NSSound
  • Index(es):
    • Date
    • Thread